View Single Post
Old 2005-01-07, 06:39 PM   #6
cd34
a.k.a. Sparky
 
cd34's Avatar
 
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
if you have ssh, you can use rpl

I would suggest that you do something like

cp -Rp currentdir backupdir

then

rpl -R -x .html -x .php 'texttoreplace' 'replacewith' *

that will look at only .html and .php files an d replace the text. Of course, if it is multiline, you need to use -e and map the \n for newlines.

rpl is on most distributions. In debian, apt-get install rpl

its a python script and is pretty easy to use.

you can also add -s, which will run a dry run and tell you the number of occurrences and number of files that will be changed.
__________________
SnapReplay.com a different way to share photos - iPhone & Android
cd34 is offline   Reply With Quote