--- scott lutz <[EMAIL PROTECTED]> wrote:
> I have a this fancy bit of recursive search and replace code that I
> picked 
> up somewhere, but I would greatly appreciate it if one of the gurus
> could 
> explain it in English for me:
> 
> find . -type f -print0 | xargs -0 perl -pi -e 's/<<your original text
> here>>/<<your new text here>>/g'

I assume you know you can use man to look up what find and xargs are
doing.

Perl's -p means loop through all the lines of an argument file as if it
had 

  while(<>) {
     # your stuff here
     print;
  }

around it. -i means do an in-place edit, actually changing the file.
-e says to use the following quoted code as the "# your stuff here".

So: find looks up the file list, xargs passes it to perl in discreet
chunks, and perl edits the file contents with a s///.

NOTE: this is a quick and non-thorough response. Disclaimer assumed. =o)

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to