bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replacing text in multiple files


From: Jim Meyering
Subject: Re: Replacing text in multiple files
Date: Mon, 12 Nov 2001 23:02:11 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1.50 (i686-pc-linux-gnu)

address@hidden (Paul Jarc) wrote:

> Jim Meyering <address@hidden> wrote:
>> You might want to limit the process to files that will
>> actually be changed -- sometimes it's best not to update timestamps,
>> and if you're making backups as this is, there's no point in making
>> a .bak file if it's identical to the original:
>>
>>   find . -type f -print0 | grep -l oldstr \
>>     | xargs -0 perl -pi.bak -e 's/oldstr/newstr/g'
>
> One of us is misunderstanding grep's -l option.  AIUI, -l means that

Whoops.  You're right.  That'll teach me to give advice without testing.
Thanks for keeping me honest :-)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]