Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 May 2002 13:00:29 +0100
From:      j mckitrick <jcm@FreeBSD-uk.eu.org>
To:        freebsd-questions@freebsd.org
Subject:   Why does 'sed' delete my input file?
Message-ID:  <20020531130029.B28925@dogma.freebsd-uk.eu.org>

next in thread | raw e-mail | index | archive | help

This is a simple question, but I can't find the answer.  The Daemonnews
article that seems to answer it is missing the graphics with the
screenshots.

If I want to replace all occurrences of 'foo' in a file, this is what I
tried:

sed s/foo/bar/g file1 > file1

But this deletes (overwrites?) the contents of the file.  What did I do
wrong?

Thanks...

NOTE: Please CC me, as I am not currently subscribed.  Thanks.

jm
-- 
My other computer is your windows box.

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?20020531130029.B28925>