View Single Post
Old 12-13-2006, 03:45 PM  
micker
Confirmed User
 
Join Date: Nov 2005
Location: Metro Detroit
Posts: 748
Quote:
Originally Posted by drjones View Post
For a slightly safer version of that command, that will back up your files, and only try to modify .html files, try this.. should run from the document root of your webserver.


perl -pi'.orig' -e 's/$FIND/$REPLACE/g' `find ./ -name "*.html"`

It will back up the all the original files with a .orig extension as it runs, so if you make a mistake with the regex you can start over. The files with the text substitution will have the original file name.
I realize now that I had meant for that to be cat *.html and not just the wilcard. It was late when I posted that...

I like your solution better than mine though.. I need to get more comfortable with perl.
micker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote