[Gllug] Changing case on filenames

Chris Ball chris at void.printf.net
Mon Mar 4 19:16:05 UTC 2002


>>>>> "Dylan" == Dylan Brewis <dylan at exoletus.fsnet.co.uk> writes:

    Dylan> Hi guys I've got about 1000 files copied from W9x which are
    Dylan> variously in upper and lower case. Is there an easy way to
    Dylan> get them all lower case (shell scripts or similar.) 

#!perl -w
opendir(DIR, "/path/to/dir");
@files = readdir(DIR);

foreach $file (@files) {
    rename($file, (lc $file));
}

No idea whether that'll work or not.  :)

- Chris.
-- 
$a="printf.net"; Chris Ball | chris at void.$a | www.$a | finger: chris@$a
         "In the beginning there was nothing, which exploded."


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list