#!/bin/sh
OLD=$1 
NEW=$2

list=`find -type f`
for f in $list; do
       file=`basename $f`
       if [ "$file" != "rename2.sh" ]; then
       if [ -f $f -a -r $f ]; then
            echo "$f";
            cat $f | sed "s/$OLD/$NEW/gI" "$f" > tmp
            mv -f tmp $f;
       else
            echo "Error: Cannot read $f";
       fi
       fi
done
rm -f tmp


