#!/bin/ksh # -------------------------------------------------------------------- # Change a string in all files in the current directory # NOTES: Remember to change the FROM and TO variables # -------------------------------------------------------------------- FROM="ORA72" TO="ORA734" EXCLUDE=`basename $0` for FILE in `grep -l ${FROM} * | grep -v $EXCLUDE` do cp ${FILE} ${FILE}.bak sed "s/${FROM}/${TO}/g" <${FILE} >/tmp/sed_work mv /tmp/sed_work ${FILE} done