Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Better ( rm foo; bar > foo ) < foo ?
- X-seq: zsh-users 3545
- From: Clint Adams <schizo@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Re: Better ( rm foo; bar > foo ) < foo ?
- Date: Sun, 3 Dec 2000 15:24:40 -0500
- In-reply-to: <87n1edeh8c.fsf@xxxxxxxxxxxxxxxxx>; from azure@xxxxxx on Sun, Dec 03, 2000 at 04:01:39PM +0200
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <87n1edeh8c.fsf@xxxxxxxxxxxxxxxxx>
> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author