Mixed Case Directory Names

Luke Davis ldavis at shellworld.net
Tue Nov 11 00:57:05 EST 2003


This is untested, but Try this:

#!/bin/sh
if [ -z $1 ]; then
echo "You didn't specify a directory!";
exit 1;
elif [ -d $1 ]; then
tf=/tmp/renamer.$$;
rm -f $tf;
ls *[A-Z]* | awk '{print "mv", $1, tolower($1)}' > $tf;
source $tf;
exit 0;
else echo "$1 is not a directory!";
exit 2;
fi




More information about the Speakup mailing list