[TriLUG] Changing case of files and folders

William Sutton william at trilug.org
Tue Jan 31 17:32:54 EST 2006


you need a perl script...preferably something on the order of the 
following:

-----
#!/usr/bin/perl
# use strict;

# usage:  script_name directory_to_process
my $dir = $ARGV[0];
my @files = `find $dir -type f -print`;

foreach my $file (@files)
{
    chomp($file);
    my $new = uc($file);
    `mv $dir/$file $dir/$new`;
}
-----

Of course I suggest you test that before running it, but it ought to do 
the trick...

-- 
William Sutton


On Tue, 31 Jan 2006, Roy Vestal wrote:

> I have a directory that I need to uppercase EVERY file and folder (don't 
> ask...long story).
> 
> What's the easiest way?
> 
> TIA,
> Roy
> 



More information about the TriLUG mailing list