Skip to content

Monthly Archives: March 2006

Shell script for multi-file search and replace

A useful shell script for multi-file search and replace. Replace the .java with whatever extension you want

for i in `find . -name '*.java' -o -name '*.xml'`; do
cp $i $i.temp
sed -e 's/old text/new text/g' < $i.temp > $i
rm $i.temp
echo $i updated.
done