Replace a line in the file using sed, line has a moving portion in the
center of it
There is a moving portion in the line.
sed needs to search for a line that might have anything in the center of it.
In other words we are looking to find this line by telling sed that it
starts with
aaa
and ends with
ccc
the center could be anything.
Let's say we have a file called a.txt, and this is what is in it.
a
b
aaa111ccc
sed needs to find the line that looks like..
aaa(.*)ccc
And then replace it with
"_TEST_"
The output should be aaa_TEST_bbb
No comments:
Post a Comment