2 # change_prefix: takes all of the files in the current directory starting in $1
3 # and modifies their prefix to be $2.
7 "$(basename $0): requires two parameters--the old prefix to look for in this directory"
8 echo "and the new prefix (without dots) to change the prefix to."
12 if [ ! -z "$(echo $i | sed -n -e "s/^\($1\).*\..*$/\1/p")" ]; then
13 extrabit="$(echo $i | sed -n -e "s/^$1\(.*\)\..*$/\1/p")"
14 suffix="$(echo $i | sed -n -e "s/^$1.*\.\(.*\)$/\1/p")"
15 #echo extrabit is $extrabit
17 mv "$i" "$2$extrabit.$suffix"