LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author] [stats]
  From: Andrew Lord <andrewlord@internode.on.net>
  To  : <linuxsa@linuxsa.org.au>
  Date: Wed, 15 Jan 2003 21:40:32 +1030

Re: Search & Replace

On Sun, 12 Jan 2003 02:05 pm, you wrote:
> Andrew Lord wrote:
> >> How about (untested):?
> >>
> >> find . --exec perl -pi 's/targetText/replacementText/g' {} \;
> >
> > Well I tried this as you suggested and the response result was:
> >
> > find: invalid predicate `-pi'
>
> Well, Ant did say it was untested.  It should be "-exec", not "--exec".

Yes, no worries. I did try that too.  Ant's suggestion is as appreciated as 
all suggestions I've received.  :) Thanks again Ant.

PS I've now found that Ant's script works on all text type files, recursively, 
if the -e option is included and -exec is used.

ex.
find . -exec perl -pi -e 's/this/that/g' {} \;


Cheers,

Andrew Lord

-- 
LinuxSA WWW: http://www.linuxsa.org.au/ IRC: #linuxsa on irc.openprojects.net
To unsubscribe from the LinuxSA list:
  mail linuxsa-request@linuxsa.org.au with "unsubscribe" as the subject


Index: [thread] [date] [subject] [author] [stats]
Return to the LinuxSA Mailing List Information Page