Quote:
Originally Posted by micker
ok, if all the files are in the same directory you can just run this...
cat * | sed 's/$FIND/$REPLACE/g'
change $FIND to what you want to match and $REPLACE with what you want to change it to.
|
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.