TEMP_VAR=`find . -type f -iname "*xml*"` echo $TEMP_VAR | while read X do cat $X | grep "MIG_Host" if [[ $? -eq 0 ]]; then cat $X | sed "s/217.171.101.225/100.100.100.100/g" > temp_file chmod 777 $X cat temp_file > $X rm -f temp_file fi done