changing file names to lowercase

hey guys

having some trouble figuring this out.
my program is supposed to take a name of a directory as a command line argument and change the filenames inside that directory to lowercase.

what i dont get is how you access that directory and go thru all the files and change the filenames to lowercase.

would you do smth like this to access the directory

eg:

if [ -e $1 -a -d $1 ]; then
echo Directory $PWD/$1 exits // show that the directory exits

cd $1 // is this how you would get access to the directory??
// if yes, how do u go thru the filenames and change
// to lowercase

would appreciate it if someone could give me a hand

milos

Milos,

Since this really sounds like a homework problem, I won't code it for you, but I'd be happy to point you in the right direction. You can use a for loop to run through the files. The 'tr' command using [a-z] [A-Z] can be used to convert your file names.

Cheers,

Keith