On Tuesday 11 December 2007 17:20:50 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 ?
> _______________________________________________
> [email protected] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "[EMAIL PROTECTED]"

just use -e s/foo/bar/ as many times as needed.

e.g.

%cat afile
foo1 foo3 foo2 foo7
%sed -e s/foo1/bar1/ -e s/foo2/bar2/ -e s/foo3/bar3/ -i .bak afile
%cat afile.bak
foo1 foo3 foo2 foo7
%cat afile
bar1 bar3 bar2 foo7

Dan
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to