Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Dec 2007 15:32:42 -0600
From:      Trix Farrar <trix@basement.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: How to replace two strings in a file in the same time with sed	command ?
Message-ID:  <20071211213239.GC1562@basement.net>
In-Reply-To: <002801c83c11$cd434e70$dc96eed5@ihlasnetym>
References:  <002801c83c11$cd434e70$dc96eed5@ihlasnetym>

next in thread | previous in thread | raw e-mail | index | archive | help

--0vzXIDBeUiKkjNJl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Dec 11, 2007 at 06:20:50PM +0200, 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 ?

You can specify the "-e command" parameter multiple times on a line:

$ sed -e 's/foo/fee/g' -e 's/bar/baz/e' filename.txt

--=20
John D. "Trix" Farrar               __\\|//__               Basement.NET
trix@basement.net                   (` o-o ')   http://www.basement.net/
-----------------------------------ooO-(_)-Ooo--------------------------

--0vzXIDBeUiKkjNJl
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFHXwH3Un6S0hqD4tsRAhAAAJ44smdTSu6t0emxlMF5NlGLijOL/ACfaCq9
2CneBuVulkCn3bqI6RSv5/A=
=gz5P
-----END PGP SIGNATURE-----

--0vzXIDBeUiKkjNJl--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071211213239.GC1562>