From owner-freebsd-questions@FreeBSD.ORG Tue Dec 11 17:00: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 AFD0A16A417 for ; Tue, 11 Dec 2007 17:00:13 +0000 (UTC) (envelope-from barry.byrne@wbtsystems.com) Received: from hermes.wbtsystems.com (hermes.wbtsystems.com [193.120.231.28]) by mx1.freebsd.org (Postfix) with ESMTP id 86E1213C457 for ; Tue, 11 Dec 2007 17:00:13 +0000 (UTC) (envelope-from barry.byrne@wbtsystems.com) Received: from SUNYA (sunya.wbt.wbtsystems.com [10.12.1.197]) by hermes.wbtsystems.com (Postfix) with ESMTP id 70318F740F; Tue, 11 Dec 2007 17:00:11 +0000 (GMT) From: "Barry Byrne" To: "'Halid Faith'" , References: <002801c83c11$cd434e70$dc96eed5@ihlasnetym> Date: Tue, 11 Dec 2007 17:00:08 -0000 Message-ID: <01f401c83c17$48fffef0$c5010c0a@SUNYA> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <002801c83c11$cd434e70$dc96eed5@ihlasnetym> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Thread-Index: Acg8Fa8dSHF7vSyRT5mLqRB4SZFs5gAAXksw Cc: Subject: RE: How to replace two strings in a file in the same time with sedcommand ? 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 17:00:13 -0000 > -----Original Message----- > From: owner-freebsd-questions@freebsd.org > [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Halid Faith > Sent: 11 December 2007 16:21 > I want to replace two or more strings in a file in the same > time with sed command. > How do I that ? Halid: You haven't said exactly what you want to do, but something like this should get you started. sed 's/oldstring1/newstring1/g; s/oldstring2/newstring2/g' < infile > outfile