Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Nov 2002 03:23:54 +0800 (CST)
From:      =?iso-8859-1?q?adrian=20kok?= <adriankok2000@yahoo.com.hk>
To:        freebsd-questions@FreeBSD.ORG
Subject:   please help: how do I replace words
Message-ID:  <20021121192354.42378.qmail@web21207.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
Hi all

I have problem to replace words 
from 192.168.0.1 to 172.16.0.1 in file abc.com

file content:
abc.com           192.168.0.1
localhost.abc.com 127.0.0.1

I tried:

sed -n 's/192.168.0.1/172.16.0.1/w abc.com.tmp'
abc.com

file abc.com.tmp
only shows l line
abc.com           172.16.0.1
and missing localhost.abc.com 127.0.0.1



I tried and it is same!
sed -n 's/192.168.0.1/172.16.0.1/gw abc.com.tmp'
abc.com

I can't use perl because the sed is within shell
script

TIA















_______________________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com.hk address at http://mail.english.yahoo.com.hk

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021121192354.42378.qmail>