George Georgalis wrote:
On Mon, Jun 14, 2004 at 04:42:40PM -0500, JupiterHost.Net wrote:


George Georgalis wrote:


In my perl notes I found this for recursive replace....

I want to replace all instances of oldstring with newstring in html
files, ./ and below.

perl -i -e 's/oldstring/newstring/g;' $( find ./ -name '*.html' )

I know how to script it up with sed, but I'm interested in why this
one-liner is not working (does nothing, no error), best I can tell it
should work.

Does find ./ -name '*.html' by itself list the files you want? if so try this: perl -i -e 's/oldstring/newstring/g;' `find ./ -name '*.html'`



well no, in fact this doesn't even work for the current directory

 perl -i -e "s/old/new/g;" *html

is my perl broken?

Try pie:

perl -p -i -e "s/old/new/g" *html

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to