From owner-freebsd-questions@FreeBSD.ORG Tue Dec 11 17:10:31 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 E091B16A41B for ; Tue, 11 Dec 2007 17:10:31 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) Received: from blaster.systems.pipex.net (blaster.systems.pipex.net [62.241.163.7]) by mx1.freebsd.org (Postfix) with ESMTP id BA12513C44B for ; Tue, 11 Dec 2007 17:10:31 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) Received: from [192.168.23.2] (62-31-10-181.cable.ubr05.edin.blueyonder.co.uk [62.31.10.181]) by blaster.systems.pipex.net (Postfix) with ESMTP id 11A2FE00136E; Tue, 11 Dec 2007 17:04:24 +0000 (GMT) Message-ID: <475EC318.90104@dial.pipex.com> Date: Tue, 11 Dec 2007 17:04:24 +0000 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.13) Gecko/20061205 X-Accept-Language: en MIME-Version: 1.0 To: Halid Faith , freebsd-questions@freebsd.org References: <002801c83c11$cd434e70$dc96eed5@ihlasnetym> In-Reply-To: <002801c83c11$cd434e70$dc96eed5@ihlasnetym> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: 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 17:10:32 -0000 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