[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] find/replace ever instance of X with Y in *
- Subject: [ale] find/replace ever instance of X with Y in *
- From: pete.hardie at gmail.com (Pete Hardie)
- Date: Mon, 22 Jan 2007 20:05:05 -0500
- In-reply-to: <1169512190.18146.3.camel@localhost>
- References: <1169508538.16133.3.camel@localhost> <[email protected]> <1169512190.18146.3.camel@localhost>
On 1/22/07, Jim Popovitch <jimpop at yahoo.com> wrote:
> On Mon, 2007-01-22 at 18:34 -0500, Pete Hardie wrote:
> > then sed -e "s/X/Y/g" <shell expressiong firl all files Z>
>
> Are the angle brackets above for shell redirection or are they being
> used to describe a file spec option? If the latter, then won't sed
> output to STDOUT? You words "shell expressiong firl all files Z" leave
> me unsure how to take them. ;-)
Mea culpa. I forgot that when addressing Unix users, <, and > are
meaningful...:->
Once more, with feeling:
sed -ibak -e "s/X/Y/g" $j
if you have the FSF sed - the -ibak option does in-place replacement,
with a backup copy named filename.bak, and treats files separately.
If you don't have GNU sed, then this
for J in Z
do
sed -e "s/X/Y/g" $j > $j.bak
cp $j.bak $j
done
will do the same.
>
> -Jim P.
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
>
>
>
--
Pete Hardie
--------
Better Living Through Bitmaps