#!/bin/bash
#===============================================================================
#
#          FILE:  rename_files.sh
# 
#         USAGE:  ./rename_files.sh 
# 
#   DESCRIPTION:  Rename a series of files with new name
# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR:  John Ryland (JR), (jryland@invertedlogic.com)
#       COMPANY:  InvertedLogic
#       VERSION:  1.0
#       CREATED:  18/03/2011
#      REVISION:  ---
#===============================================================================


if [ $# != 2 ]
then
    echo "Usage: $0 Old-suffix New-suffix"
    exit 0
fi

OLD=$1
NEW=$2


for FILE in "$OLD"*
do
    NEWFILE=`echo "$FILE" | sed s/"$OLD"/"$NEW"/`
    mv "$FILE" "$NEWFILE"
done


