From owner-freebsd-questions Fri May 31 5:22:24 2002 Delivered-To: freebsd-questions@freebsd.org Received: from probity.mcc.ac.uk (probity.mcc.ac.uk [130.88.200.94]) by hub.freebsd.org (Postfix) with ESMTP id C2A5E37B40E for ; Fri, 31 May 2002 05:22:19 -0700 (PDT) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97]) by probity.mcc.ac.uk with esmtp (Exim 2.05 #7) id 17DlQ4-000N0J-00; Fri, 31 May 2002 13:22:12 +0100 Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.11.6/8.11.1) id g4VCMCS29215; Fri, 31 May 2002 13:22:12 +0100 (BST) (envelope-from jcm) Date: Fri, 31 May 2002 13:22:11 +0100 From: j mckitrick To: Benoit Lacherez Cc: freebsd-questions@freebsd.org Subject: Re: Why does 'sed' delete my input file? Message-ID: <20020531132211.A29199@dogma.freebsd-uk.eu.org> References: <20020531130029.B28925@dogma.freebsd-uk.eu.org> <20020531141421.A72043@bisclavret.iris33.ac-bordeaux.f> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20020531141421.A72043@bisclavret.iris33.ac-bordeaux.f>; from blacherez@ac-bordeaux.fr on Fri, May 31, 2002 at 02:14:21PM +0200 X-Scanner: exiscan *17DlQ4-000N0J-00*8XUpYCfWevo* (Manchester Computing, University of Manchester) 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 Wow! Lots of fast responses. This is what makes BSD great. Thanks, all. On Fri, May 31, 2002 at 02:14:21PM +0200, Benoit Lacherez wrote: | The solution is to read the file first, then to write in it : | | cat file1 | sed 's/foo/bar/g' > file1 Perfect! jm -- There are only 10 types of people in this world: those who understand binary, and those who don't. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message