From owner-freebsd-questions Fri May 31 5: 0:38 2002 Delivered-To: freebsd-questions@freebsd.org Received: from serenity.mcc.ac.uk (serenity.mcc.ac.uk [130.88.200.93]) by hub.freebsd.org (Postfix) with ESMTP id 21C0637B401 for ; Fri, 31 May 2002 05:00:31 -0700 (PDT) Received: from dogma.freebsd-uk.eu.org ([130.88.200.97]) by serenity.mcc.ac.uk with esmtp (Exim 2.05 #6) id 17Dl53-000PKA-00 for freebsd-questions@freebsd.org; Fri, 31 May 2002 13:00:29 +0100 Received: (from jcm@localhost) by dogma.freebsd-uk.eu.org (8.11.6/8.11.1) id g4VC0Tt28994 for freebsd-questions@freebsd.org; Fri, 31 May 2002 13:00:29 +0100 (BST) (envelope-from jcm) Date: Fri, 31 May 2002 13:00:29 +0100 From: j mckitrick To: freebsd-questions@freebsd.org Subject: Why does 'sed' delete my input file? Message-ID: <20020531130029.B28925@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.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 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