rp_xml.sh ##!/usr/bin ### ### rp.sh ### ### Replace oldphrase with newphrase ### #date if [ $# -lt 3 ]; then echo "Usage: rp.sh old phrase : new phrase" exit else old=`echo $@ | cut -d: -f1 | sed "s, $,,"` new=`echo $@ | cut -d: -f2 | sed "s,^ ,,"` fi for i in `find . -name \*.xml` do #echo $i if `grep "$old" $i >/dev/null 2>/dev/null` then echo " " echo "File: $i" echo "Archive: rp_archive.sh" echo "Old: $old" echo "New: $new" echo "rp.sh $old : $new" >> rp_archive.sh sed "s+$old+$new+g" $i > $i.tmp mv $i.tmp $i fi done