in reply to Finding files in unix irrespective of case
Updated: So the hash keys and input filenames are now compared in lowercase, but the symlinks are done with both original cases.open MISS, 'missing.txt' or die "Cant open missing: $!\n"; my %missing = map {(lc($_),$_)} <MISS>; close MISS; opendir DIR, '.' or die "Can't open pwd: $!\n"; while (defined($_=readdir(DIR))) { # convert filename to lowercase and see if it is in list if (exists $missing{lc($_)} ) { symlink($_, $missing{lc($_)}); delete $missing{lc($_)}; } } closedir DIR; print "Still not found:\n\n" . join("\n", keys %missing) . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Finding files in unix irrespective of case
by ashok (Sexton) on Jan 06, 2001 at 07:19 UTC |