From owner-freebsd-questions@FreeBSD.ORG Tue Dec 11 22:42:13 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2714F16A496 for ; Tue, 11 Dec 2007 22:42:13 +0000 (UTC) (envelope-from trix@basement.net) Received: from fran.basement.net (fran.basement.net [66.139.76.84]) by mx1.freebsd.org (Postfix) with ESMTP id E636E13C53B for ; Tue, 11 Dec 2007 22:42:12 +0000 (UTC) (envelope-from trix@basement.net) Received: from faith.basement.net (adsl-065-013-140-007.sip.bna.bellsouth.net [65.13.140.7]) by fran.basement.net (8.12.8/8.12.8) with ESMTP id lBBLWhLh009060 for ; Tue, 11 Dec 2007 15:32:44 -0600 Received: from faith.basement.net (localhost [127.0.0.1]) by faith.basement.net (8.13.8/8.13.8) with ESMTP id lBBLWhhu003143 for ; Tue, 11 Dec 2007 15:32:43 -0600 (CST) (envelope-from trix@basement.net) Received: (from trix@localhost) by faith.basement.net (8.13.8/8.13.8/Submit) id lBBLWgqi003142 for freebsd-questions@freebsd.org; Tue, 11 Dec 2007 15:32:42 -0600 (CST) (envelope-from trix@basement.net) X-Authentication-Warning: faith.basement.net: trix set sender to trix@basement.net using -f Date: Tue, 11 Dec 2007 15:32:42 -0600 From: Trix Farrar To: freebsd-questions@freebsd.org Message-ID: <20071211213239.GC1562@basement.net> Mail-Followup-To: Trix Farrar , freebsd-questions@freebsd.org References: <002801c83c11$cd434e70$dc96eed5@ihlasnetym> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0vzXIDBeUiKkjNJl" Content-Disposition: inline In-Reply-To: <002801c83c11$cd434e70$dc96eed5@ihlasnetym> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=0.1 required=5.0 tests=RDNS_DYNAMIC autolearn=no version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on fran.basement.net Subject: Re: How to replace two strings in a file in the same time with sed command ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2007 22:42:13 -0000 --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--