#
# Recursive script for following down a directory tree and make all file name lower case.
#
# ex: suninstlowcase
#

for x1 in `ls -1`
do
  if [ -f $x1 ]				#Check for regular file
   then
#   echo `pwd`/$x1			#Display name of file just found
    j1=`echo $x1 | tr '[A-Z]' '[a-z]'`	#Check for Upper Case Letters
    if [ ${x1} != ${j1} ]		#If we found any, then...
     then
      mv $x1 $j1>/dev/null 2>&1		#Change name to all lower case
#     echo `pwd`/$j1			#Display new name
    fi
  elif [ -d $x1 ]			#Check for a directory
   then
    cd $x1				#Change to directory
    $0					#Recurse into directory and do again
    cd ..				#Change back to original directory
  fi
done
