From owner-freebsd-questions Wed Jul 9 17:47:16 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id RAA25909 for questions-outgoing; Wed, 9 Jul 1997 17:47:16 -0700 (PDT) Received: from Hydro.CAM.ORG (Hydro.CAM.ORG [198.168.100.7]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id RAA25897 for ; Wed, 9 Jul 1997 17:47:10 -0700 (PDT) Received: from siren.sirn.org (owilson.HIP.CAM.ORG [205.151.117.34]) by Hydro.CAM.ORG (8.8.4/8.8.4) with SMTP id UAA19508; Wed, 9 Jul 1997 20:47:03 -0400 (EDT) Message-ID: <33C43163.41C67EA6@cam.org> Date: Wed, 09 Jul 1997 20:48:35 -0400 From: Oliver Wilson Organization: SIRN X-Mailer: Mozilla 3.0Gold (X11; I; FreeBSD 2.1.5-RELEASE i386) MIME-Version: 1.0 To: Simon N Atkin CC: freebsd-questions@FreeBSD.ORG Subject: Re: SED remove from live file References: <33C3F7B9.5636@enta.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Simon N Atkin wrote: > > if we use > > cat simat.dat | sed "s/\.//g" > simat.dat > then we end up with simat.dat being empty and 0 bytes. Here a way using a script with the following contents... #!/usr/local/bin/ksh # for fname in $* do sed "s/\.//" $fname > $fname"x" mv $fname"x" $fname done # ...and is executed as follows: $ This script will remove "." 's from one or multiple files. ...I think there's a bug in FreeBSD 'sed' implementation ;) Oliver Wilson MDM Inc. --