Making all files lowercase

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: sinck@corp.quepasa.comsinckcorp.quepasa.com
Date:  
Subject: Making all files lowercase

Ok, just because I can, here's the perl solution I use for exactly
this purpose. It doesn't use the handy tmp dir that JLF uses, but
I've used it and expect it to replace/clobber files in the cwd.

It works for me, but YMMV. :-)


------------------
# down cases the names
opendir(UP,".");
@names=readdir(UP);
closedir(UP);
while ($name=shift(@names))
{
    next if (($name =~ /^[\.]{1,2}/) || ("\L$name" eq $name));
    system ("mv $name \L$name\n");
}
exit 0;
------------------


That test keeps it from trying to lowercase dot-files and from converting
already lowercase files to lowercase.

David