Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Jul 1997 20:48:35 -0400
From:      Oliver Wilson <owilson@CAM.ORG>
To:        Simon N Atkin <simat@enta.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: SED remove from live file
Message-ID:  <33C43163.41C67EA6@cam.org>
References:  <33C3F7B9.5636@enta.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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:
$ <scriptname> <filename expression>

This script will remove "." 's from one or multiple files.
...I think there's a bug in FreeBSD 'sed' implementation ;)


Oliver Wilson
MDM Inc.
-- 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?33C43163.41C67EA6>