Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Jun 2002 20:53:38 +0200
From:      Benoit Lacherez <blacherez@ac-bordeaux.fr>
To:        Matthew Hunt <mph@astro.caltech.edu>
Cc:        j mckitrick <jcm@FreeBSD-uk.eu.org>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Why does 'sed' delete my input file?
Message-ID:  <20020602205338.A22684@bisclavret>
In-Reply-To: <20020531094720.C34758@wopr.caltech.edu>; from mph@astro.caltech.edu on Fri, May 31, 2002 at 09:47:20AM -0700
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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