#!/bin/sh # # Edit the domain name contained in certain files # files="$HOME/.ftpfindrc $HOME/.ircrc $HOME/.knd $HOME/.mp3findrc $HOME/.mp3listrc $HOME/scripts/sshany $HOME/scripts/xauthsetup" [ $# -lt 2 ] && { echo "usage: chname " >&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 2>&1 done .