Question: How do I append text in the middle of a line in a text file? Let say, I have file foo.txt
>> echo foo.txt
line1.This.is;a.test /var/messages
line2.This is #a test
Now I would like to search in the file foo.txt for a string that contain "line1". Then append string "GOT.IT" to this line so it will look like this:
line1.This.is;a.testGOT.IT /var/messages
Basically I want to append "GOT.IT" to the first white-space on that line
It can be done with either sed or awk ...
thanks in advance
>> echo foo.txt
line1.This.is;a.test /var/messages
line2.This is #a test
Now I would like to search in the file foo.txt for a string that contain "line1". Then append string "GOT.IT" to this line so it will look like this:
line1.This.is;a.testGOT.IT /var/messages
Basically I want to append "GOT.IT" to the first white-space on that line
It can be done with either sed or awk ...
thanks in advance