From owner-freebsd-questions Wed Mar 12 0:26:45 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D158537B401 for ; Wed, 12 Mar 2003 00:26:43 -0800 (PST) Received: from hobbiton.shire.net (hobbiton.shire.net [206.71.64.250]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0FD943FCB for ; Wed, 12 Mar 2003 00:26:42 -0800 (PST) (envelope-from chad@shire.net) Received: from [204.228.149.206] (helo=shire.net) by hobbiton.shire.net with asmtp (Exim 4.10) id 18t1ZQ-0008Ab-00; Wed, 12 Mar 2003 01:26:41 -0700 Date: Wed, 12 Mar 2003 01:26:38 -0700 Mime-Version: 1.0 (Apple Message framework v551) Cc: freebsd-questions@FreeBSD.ORG To: Kok Kok From: Chad Leigh -- Shire.Net LLC In-Reply-To: <20030312061655.26510.qmail@web13305.mail.yahoo.com> Message-Id: <5883C98B-5464-11D7-BD73-003065A70D30@shire.net> X-Mailer: Apple Mail (2.551) Subject: Re: sed to replace the words Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-3.4 required=6.5 tests=IN_REP_TO version=2.31 X-Spam-Level: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tuesday, Mar 11, 2003, at 23:16 US/Mountain, Kok Kok wrote: > Hi all > > I have question how to replace words using sed > > ./script 61.100 192.168 > > The script is > #!/bin/sh > sed -e 's/$2/$1/g' file > newfile > > The problem is 192.168 can't replace 61.100 in the > newfile try ./script 61\.100 192\.168 Just a guess. I am no guru, but have done some similar stuff recently... (actually, I used sed for something similar to this, but perl for something almost exactly the same as this) Chad > > Please help > > Thank you > > > > > ______________________________________________________________________ > Post your free ad now! http://personals.yahoo.ca > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message