Hi,
I'm trying to add 17 new lines after a certain string is found. The string is located on line 94 of a 233 line file.
I've found the following, which adds the new lines correctly, but does not write lines 96-233 to the output file:
awk '1;$1=="name=mark"{exit}END{print "name2=scott\n name3=harry\n name4=dick etc...."}' m.m > m.new
Can someone let me know how I can make the cmd continue and write out the other 140 lines after i've inserted the new lines?
Thanks in advance for any help
fidge
I'm trying to add 17 new lines after a certain string is found. The string is located on line 94 of a 233 line file.
I've found the following, which adds the new lines correctly, but does not write lines 96-233 to the output file:
awk '1;$1=="name=mark"{exit}END{print "name2=scott\n name3=harry\n name4=dick etc...."}' m.m > m.new
Can someone let me know how I can make the cmd continue and write out the other 140 lines after i've inserted the new lines?
Thanks in advance for any help
fidge