#!/usr/bin/bash # cd cd web pwd if [ $# != 2 ]; then echo Usage: $0 string1 string2 exit 1 fi for i in *.html; do grep $1 $i > /dev/null || continue echo -n "$i..." cat $i | sed -e "s|$1|$2|g" > ~/tmp/_x || exit 1 mv ~/tmp/_x $i || exit 1 chmod 644 $i || exit 1 echo OK done exit .