[oclug] ...and speaking of awk...

David F. Skoll dfs at roaringpenguin.com
Fri Feb 23 15:01:44 EST 2001


On Fri, 23 Feb 2001, Jonathan Earle wrote:

> One other sed related question though.  Is it possible to combine more than
> one search/replace pattern in one sed call?

Yes.  If you've ever used GNU Autoconf, you've seen that the
"configure" script that it produces creates a single sed command with
dozens of s/foo/bar expressions.  Do it like this:

	sed -e 's/foo1/bar1/' -e 's/foo2/bar2/g' ... infile > outfile

You can have as many "-e command" options as you want.

--
David.




More information about the OCLUG mailing list