From owner-freebsd-questions Thu Nov 21 11:54:25 2002 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 3CDB737B401 for ; Thu, 21 Nov 2002 11:54:23 -0800 (PST) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2224C43E88 for ; Thu, 21 Nov 2002 11:54:23 -0800 (PST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.6) id gALJsM0h029157; Thu, 21 Nov 2002 13:54:22 -0600 (CST) (envelope-from dan) Date: Thu, 21 Nov 2002 13:54:22 -0600 From: Dan Nelson To: Norbert Koch Cc: adrian kok , freebsd-questions@FreeBSD.ORG Subject: Re: please help: how do I replace words Message-ID: <20021121195422.GD86807@dan.emsphone.com> References: <20021121192354.42378.qmail@web21207.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i 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 In the last episode (Nov 21), Norbert Koch said: > adrian kok writes: > > > 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 > > sed 's/192.168.0.1/172.16.0.1/' abc.com > abc.com.tmp Also note that on FreeBSD 4.7 and newer, you can do an in-place update of a file with sed if you use the -i flag. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message