# change_prefix: takes all of the files in the current directory starting in $1 # and modifies their prefix to be $2. if [ -z "$1" -o -z "$2" ]; then echo \ "`basename $0`: requires two parameters--the old prefix to look for in this directory and" echo 'the new prefix (without dots) to change the prefix to.' \exit fi for i in *; do if [ "`echo $i | sed -n -e 's/\([^.]*\)\..*$/\1/p'`" = $1 ]; then mv $i $2.`strip_prefix $i` fi done