nngdemi
asked on
sed to add "me" at the end of line
Hi,
I have a text file name file1 in /tmp/file1. The content of the file
is:
test1 costs
test2 money
test3 deal
I like to use sed to look for test2
and add "me" at the end of the line:
so the output of the file1 above should
be:
test1 costs
test2 money me
test3 deal
thanks in advance
I have a text file name file1 in /tmp/file1. The content of the file
is:
test1 costs
test2 money
test3 deal
I like to use sed to look for test2
and add "me" at the end of the line:
so the output of the file1 above should
be:
test1 costs
test2 money me
test3 deal
thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
excellent.
Both work.
thanks.
Both work.
thanks.
An alternative (but very similar) solution would be:
sed "s/^test2.*/& me/" </tmp/file1 >/tmp/file1.tmp
mv /tmp/file1.tmp /tmp/file1