:
# @(#) tolower v1.0
#

if [ ! "$*" ]
then
   echo "Preparing to rename ALL files. OK to continue? (y/n) \c"
   read OK
   case $OK in
      [yY])
	 LIST=`ls`
         break
         ;;
      *)
         echo "Usage : `basename $0` file [ file ... ]"
         exit 1
         ;;
   esac
else
   LIST=$*
fi

for NAME in $LIST
do
   NEW_NAME=`echo $NAME | tr "[A-Z]" "[a-z]"`
   if [ "$NAME" != "$NEW_NAME" ]
   then
      echo "Renaming $NAME to $NEW_NAME"
      mv ./$NAME ./$NEW_NAME
   fi
done

