[ale] Perl question
John Wells
jb at sourceillustrated.com
Tue Jul 2 14:31:00 EDT 2002
Matthew,
Try:
find . -name "*.php" -maxdepth 3 | xargs perl -p -i.bak -e "s/foo/bar/;"
Matthew Brown said:
> I am reading in the Camel book (p.332) about the following command line:
>
> $ perl -p -i.bak -e "s/foo/bar/;"
>
> Now, the way I read it, it should take the file given to it (via a
> command line as below), open it, swithc all instances of 'foo' with
> 'bar', then close the file, giving you a backup of the original file
> named 'originalfilename.bak'. Is this right?
>
> The command I am running follows:
>
> $ find . -name "*.php" -maxdepth 3 | perl -p -i.bak -e "s/foo/bar/;"
>
> On my box, this simply tries to change 'foo' to 'bar' in the file
> _names_ handed to it. What am I missing?
>
> Best regards,
> Matthew Brown, President
> CorData, Inc.
> O: (770) 795-0089
> F: (404) 806-4855
> E: matthew.brown at cordata.net
>
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
More information about the Ale
mailing list