From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21342 invoked from network); 3 Dec 2000 20:25:01 -0000 Received: from sunsite.dk (HELO sunsite.auc.dk) (130.225.51.30) by ns1.primenet.com.au with SMTP; 3 Dec 2000 20:25:01 -0000 Received: (qmail 22134 invoked by alias); 3 Dec 2000 20:24:44 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3545 Received: (qmail 22127 invoked from network); 3 Dec 2000 20:24:43 -0000 Date: Sun, 3 Dec 2000 15:24:40 -0500 From: Clint Adams To: zsh-users@sunsite.auc.dk Subject: Re: Better ( rm foo; bar > foo ) < foo ? Message-ID: <20001203152440.A23776@dman.com> References: <87n1edeh8c.fsf@senstation.vvf.fi> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <87n1edeh8c.fsf@senstation.vvf.fi>; from azure@iki.fi on Sun, Dec 03, 2000 at 04:01:39PM +0200 > TMPFILE=$(mktemp "$(dirname "$FILE")/XXXXXX") || exit 1 > sed 's/foo/bar/g' < "$FILE" > "$TMPFILE" || { rm -f "$TMPFILE" ; exit 1 } > mv "$TMPFILE" "$FILE" I find that perl -pi -e 's/foo/bar/g' $FILE is much less of a hassle, if that's the complexity you're dealing with.