From owner-freebsd-questions Sun Jun 2 11:59: 3 2002 Delivered-To: freebsd-questions@freebsd.org Received: from postfix2-1.free.fr (postfix2-1.free.fr [213.228.0.9]) by hub.freebsd.org (Postfix) with ESMTP id 36FE137B400 for ; Sun, 2 Jun 2002 11:58:59 -0700 (PDT) Received: from bart (bordeaux-1-a7-62-147-86-229.dial.proxad.net [62.147.86.229]) by postfix2-1.free.fr (Postfix) with ESMTP id 517405DC; Sun, 2 Jun 2002 20:58:56 +0200 (CEST) Received: (from blacherez@localhost) by bart.boece.foo (8.9.3/8.9.3) id UAA22704; Sun, 2 Jun 2002 20:53:38 +0200 Date: Sun, 2 Jun 2002 20:53:38 +0200 From: Benoit Lacherez To: Matthew Hunt Cc: j mckitrick , freebsd-questions@FreeBSD.ORG Subject: Re: Why does 'sed' delete my input file? Message-ID: <20020602205338.A22684@bisclavret> References: <20020531130029.B28925@dogma.freebsd-uk.eu.org> <20020531141421.A72043@bisclavret.iris33.ac-bordeaux.f> <20020531132211.A29199@dogma.freebsd-uk.eu.org> <20020531094720.C34758@wopr.caltech.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.0.1i In-Reply-To: <20020531094720.C34758@wopr.caltech.edu>; from mph@astro.caltech.edu on Fri, May 31, 2002 at 09:47:20AM -0700 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 Matthew Hunt a écrit : > On Fri, May 31, 2002 at 01:22:11PM +0100, j mckitrick wrote: > > > | cat file1 | sed 's/foo/bar/g' > file1 > > > > Perfect! > > I don't think that's guaranteed to work at all. There's no assurance > that cat will have read then entire contents of file1 before the shell > opens it for writing. > You're right! I had never done that with a big file, but actually it is truncated. So I'll do with a temporary file, now. Thank you very much! -- Benoit Lacherez Académie de Bordeaux -- CATICE Projet de traduction de la documentation de Python: http://frpython.sourceforge.net/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message