How to replace two strings in a file in the same time with sed command ?

Alex Zbyslaw xfb52 at dial.pipex.com
Tue Dec 11 09:10:32 PST 2007


Halid Faith wrote:

>I want to replace two or more strings in a file in the same time with sed command.
>How do I that ?
>  
>
Do you mean something like:

sed -e 's/string1/replacement1/g' -e 's/string2/replacement2/g'

or

sed -f instructions.sed

instructions.sed:

s/string1/replacement1/g
s/string2/replacement2/g

--Alex



More information about the freebsd-questions mailing list