From owner-freebsd-questions Tue Mar 11 22:26:51 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 4D57037B404 for ; Tue, 11 Mar 2003 22:26:49 -0800 (PST) Received: from chimera.noanet.net (chimera.noanet.net [66.119.192.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6465A43F3F for ; Tue, 11 Mar 2003 22:26:48 -0800 (PST) (envelope-from mksmith@noanet.net) Received: from mkssony (dsl081-001-094.sea1.dsl.speakeasy.net [64.81.1.94]) by chimera.noanet.net (8.12.2/8.12.2) with SMTP id h2C6QlkT006872; Tue, 11 Mar 2003 22:26:48 -0800 (PST) Reply-To: From: "Michael K. Smith" To: "'Kok Kok'" , Subject: RE: sed to replace the words Date: Tue, 11 Mar 2003 22:26:43 -0800 Organization: NoaNet Message-ID: <004b01c2e860$5bba5dc0$5e015140@mkssony> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 In-Reply-To: <20030312061655.26510.qmail@web13305.mail.yahoo.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Importance: Normal 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 Does it have to be sed specifically? How about: cat test.sed | awk '{print $2,$1}' > newfile Mike Michael K. Smith NoaNet 206.219.7116 (work) 206.579.8360 (cell) mksmith@noanet.net http://www.noanet.net > -----Original Message----- > From: owner-freebsd-questions@FreeBSD.ORG > [mailto:owner-freebsd-questions@FreeBSD.ORG] On Behalf Of Kok Kok > Sent: Tuesday, March 11, 2003 10:17 PM > To: freebsd-questions@FreeBSD.ORG > Subject: sed to replace the words > > > 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 > > 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