in reply to Replace across files (extreme newbie)
Using the -exec flag will exec a perl for every file found. This can be slow and painful - the most expensive part of perl is the initial load. By piping to xargs, you start perl but once.find . -type f | xargs perl -pi.bak -e 's/string x/string y/g'
If you you have too many files to fit on one command line, you can modify the command like this:
which will cause xargs to call perl with 255 files each time.find . -type f | xargs -n 255 perl -pi.bak -e 's/string x/string y/g'
Mik
Mik Firestone ( perlus bigotus maximus )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: RE: Replace across files (extreme newbie)
by Anonymous Monk on Oct 10, 2001 at 13:36 UTC | |
by busunsl (Vicar) on Oct 10, 2001 at 14:04 UTC |