On Thu, Jun 07, 2001 at 11:50:01PM +0000, scott lutz 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'm no guru, but I'll give it a shot:
"find . -type f -print0" recurses through subdirs printing
all regular filenames separated by \0
"xargs -0" runs some code on a null-separated list of files
"perl -pi -e 's....'" runs the substitution in s/// on some
file "in place".
Ain't UNIX great?
--
[W]hen the manager knows his boss will accept status reports without
panic or preeemption, he comes to give honest appraisals.
- F. Brooks, _The Mythical Man-Month_