Could you please tell me how to separate these commands in several lines. Each line starting with the -e. I am running this on a Korn shell. thanks again.
The -e is require only if you write multiple commands as separate command line parameters, as in atojaf's example. That way without -e the second and subsequent codes would be treated as filenames.
And there is no need to capture the matched expressions with parenthesis ( () ).
Code:
sed 's/log\|car\|GO\|ON/ /g' test.txt
[gray]# or abit more readable in GNU sed[/gray]
sed -r 's/log|car|GO|ON/ /g' test.txt
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.