From owner-freebsd-questions Mon Dec 2 5:39:54 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 2FA5337B401 for ; Mon, 2 Dec 2002 05:39:53 -0800 (PST) Received: from bellavista.cz (mail.bellavista.cz [62.168.44.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4953043EC2 for ; Mon, 2 Dec 2002 05:39:50 -0800 (PST) (envelope-from neuhauser@bellavista.cz) Received: from lilith.bellavista.cz ([10.1.0.1]) by bellavista.cz (8.9.3/8.9.8) with ESMTP id OAA27260 for ; Mon, 2 Dec 2002 14:39:39 +0100 Received: from freepuppy.bellavista.cz (freepuppy.bellavista.cz [10.0.0.10]) by lilith.bellavista.cz (Postfix) with ESMTP id 2B26728 for ; Mon, 2 Dec 2002 15:37:57 +0100 (CET) Received: by freepuppy.bellavista.cz (Postfix, from userid 1001) id 3DC6D2FDAE8; Mon, 2 Dec 2002 14:39:39 +0100 (CET) Date: Mon, 2 Dec 2002 14:39:39 +0100 From: Roman Neuhauser To: questions@FreeBSD.ORG Subject: Re: is there a "replace command" ? Message-ID: <20021202133939.GR35908@freepuppy.bellavista.cz> Mail-Followup-To: questions@FreeBSD.ORG References: <20021202140543.G19865-100000@slave.east.ath.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20021202140543.G19865-100000@slave.east.ath.cx> 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 # andrew@kronos.HomeUnix.com / 2002-12-02 14:20:44 +0100: > Today Conrad Sabatier wrote: > > Recent versions of FreeBSD now have a version of 'sed' that can do these > > types of replacements "in place", i.e., without the need for a temporary > > file: > > > sed -i -e 's/^touch /rm /' infile > > No. I'm pretty sure, there is a temporary file somewhere. You can't > edit a file `in place' really, w/o a need temporary files (or ev. > memory mapping the file). With the `-i' flag sed does this for you, > ie. no need that you create a temporary file. wow, even the man page is not this anal. :) point in case: there's no tmp file from the user's perspective, and Conrad Sabatier's description is in line with the man page text: -i extension Edit files in-place, saving backups with the specified extension. If a zero-length extension is given, no backup will be saved. It is not recommended to give a zero-length extension when in-place editing files, as you risk corruption or partial content in situ­ ations where disk space is exhausted, etc. -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message