Date: Wed, 9 Jul 1997 22:59:59 -0600 (MDT) From: Wes Peters <softweyr@xmission.com> To: Oliver Wilson <owilson@CAM.ORG> Cc: questions@freebsd.org Subject: Re: SED remove from live file Message-ID: <199707100459.WAA10065@obie.softweyr.ml.org> In-Reply-To: <33C43163.41C67EA6@cam.org> References: <33C3F7B9.5636@enta.net> <33C43163.41C67EA6@cam.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Oliver Wilson writes: > 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 ;) I think you need to escape the backslash in the quoted expression on your sed command. You're telling sed to remove ".", which matches any character. Try sed "s/\\.//" $fname > $fname"x" -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://www.xmission.com/~softweyr softweyr@xmission.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707100459.WAA10065>