echo
echo "Sunbelt UNIX up_case Command Script   Version 10.6A 04 Mar 2024"
echo "(C) Copyright 2018-2024   Sunbelt Computer Software.   N999999"
echo "(C) Copyright 1987-2024   Steve White\\n"
 
if [ "$1" = "-?" -o "$#" = "0" ]
then
echo "up_case - Sunbelt script to convert directory entries from lower"
echo "          case to upper case.  Supports use of wildcards."
echo
echo "Examples:"
echo "    up_case *.pls (Convert any directory entry with .pls ext.)"
echo "    up_case *.*   (Convert all directory entries with an ext.)"
echo "    up_case *     (Convert all directory entries)"
echo
    if [ $# = 0 ]
    then
        echo "COMMAND LINE ERROR!  A file name or valid UNIX wildcard required."
     fi
exit 1
fi
 
for i in `ls $*`
do
  j=`echo $i | tr '[a-z]' '[A-Z]'`
  if [ ${i} != ${j} ]
  then
      mv $i $j
      if [ $? = "0" ]
      then
          echo "'"$i"' converted to '"$j"'".
      else
          echo "Unable to convert '"$i"' to '"$j"'".
      fi
  fi
done
