Вы можете сделать это двумя разными способами:
Первый способ - изменить ваш /etc/rc.local, который запускается один раз при старте:
сделайте ваш скрипт извлекаемым: chmod +x path_to_script/script_file
добавьте скрипт абсолютный путь в ваш /etc/rc. local перед exit 0
Второй способ:
mv path_to_script/script_file /etc/init.d/
chmod +x /etc/init.d/script_to_run
ln -s /etc/init.d/script_to_run /etc/rc.d/
В bash
вы можете попробовать
paste <(sed 's/, /:\n/g; s/$/:/; q' file) <(sed -n '3 { s/, /\n/g; p; q }' file)
head1: data2.1
head2: data2.2
head3: data2.3