Very new to Linux/Trying to understand the Sed command
I have tried to get the desired outcome and have failed.
the blue cat was chased by the brown dog
the blue cat was not chased by the brown dog
Line should read
the blue snake was chased by the brown snake
the blue car was not chased by the brown car.
I got the first line, but the words to be substituted in the second line did not change.
sed -e 's/cat/snake/' -e 's/dog/snake/' -e '/not/s/cat/car' -e 's/dog/cat/'
I have read and found that sed does not handle long line of command, so is there some way to break this up. I tried to use pipe and \n. Very new to this.
Last edited by kayjay1; 02-27-2011 at 01:35 PM.
|