在文件中的每行之後添加額外的行在文件中的每行之後添加額外的行
我需要大約1000行文件的以下任務的幫助。
INPUT
./create.pl 1eaj.out
./create.pl 1ezg.out
./create.pl 1f41.out
...
OUTPUT
./create.pl 1eaj.out
mv complex.* 1eaj
./create.pl 1ezg.out
mv complex.* 1ezg
./create.pl 1f41.out
mv complex.* 1f41
...
我知道下列命令可以添加新的線和第一部分,其使輸出像的下方。
awk ' {print;} NR % 1 == 0 { print "mv complex.* "; }'
./create.pl 1eaj.out
mv complex.*
./create.pl 1ezg.out
mv complex.*
./create.pl 1f41.out
mv complex.*
...
剩下的事怎麼辦? 非常感謝。
。 – Bernhard