Making all files lowercase

sinck@corp.quepasa.com sinck@corp.quepasa.com
Mon, 20 Mar 2000 09:12:16 -0700 (MST)


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