Find replace recursively over directory
Posted: Tue Dec 12, 2006 2:52 pm
I need to make a lot of replacements to a directory of PHP files.
In windows you can do this:but there doesn't seem to be a bash equivalent.
This is the replacement code I'm going to use:
For now I've been doing this:but I get "syntax error near unexpected token `echo'"
In windows you can do this:
Code: Select all
for /r %file in (*.php) doThis is the replacement code I'm going to use:
Code: Select all
mv $file $file.old
sed "s/OB::loadClass('/OF::loadClass('OB_/g" $file.old > $file
rm $file.oldCode: Select all
files="list
of
files
i had to compile myself"
for file in $files do
echo $file
done