I am new to shell scripting and have a request to modify multiple files. I have
the input as below
#this is line1 for [email protected]
test line 2
test line 3
this is line4 for [email protected]
test line 5
this is line6 for [email protected]
and need output like
#this is line1 for [email protected]
test line 2
test line 3
##this is line4 for [email protected]
this is line4 for [email protected]
test line 5
##this is line6 for [email protected]**
this is line6 for [email protected]
i tried the below sed command, but not able to get the required output. It is not skipping the #line and appends it.
sed -e "/abc.com/{h;s/^/##/P;x;G; /^#/!s/abc.com/xyz.com/;}" file1
is there something i am missing???
Please help and any other suggestions would also be much appreciated.
Regards, Santosh
*part of the input and part of the desired output? Nothing in your example sed command skips lines with leading#for the first bit of work.