#!/bin/sh # # Edit the www domain name contained in certain files # files="$HOME/.ircrc /usr/local/apache/conf/httpd.conf" [ $# -lt 2 ] && { echo "usage: chwwwname " >&2; exit 1; } old=$1; new=$2 for f in $files; do [ -f $f ] || continue echo ",s/$old/$new/g w" | ed $f >/dev/null done .