From owner-freebsd-questions Wed Jul 9 21:55:35 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id VAA06479 for questions-outgoing; Wed, 9 Jul 1997 21:55:35 -0700 (PDT) Received: from obie.softweyr.ml.org ([199.104.124.49]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA06471 for ; Wed, 9 Jul 1997 21:55:28 -0700 (PDT) Received: (from wes@localhost) by obie.softweyr.ml.org (8.7.5/8.6.12) id WAA10065; Wed, 9 Jul 1997 22:59:59 -0600 (MDT) Date: Wed, 9 Jul 1997 22:59:59 -0600 (MDT) Message-Id: <199707100459.WAA10065@obie.softweyr.ml.org> From: Wes Peters To: Oliver Wilson CC: questions@freebsd.org Subject: Re: SED remove from live file In-Reply-To: <33C43163.41C67EA6@cam.org> References: <33C3F7B9.5636@enta.net> <33C43163.41C67EA6@cam.org> Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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: > $ > > 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