#!/bin/ksh # Replace "OLDSTRING" with "NEWSTRING" in all ORACLE Files print - "Enter : \c" read OLDSTRING print - "Enter : \c" read NEWSTRING print - "Enter starting : \c" read DIR print - "Replacing <$OLDSTRING> with <$NEWSTRING> in <$DIR> !" print - " " print - "Is this OK [y]\c " read ANSWER if [ "$ANSWER" != "" ] then exit else for i in `find $DIR -exec grep -l $OLDSTRING {} \;` do sed "s#$OLDSTRING#$NEWSTRING#" < $i > $i.temp mv $i.temp $i chmod +x $i print - "Replacing $OLDSTRING with $NEWSTRING in $i" done fi