[ale] quick way to rename all files ?
Fletch
fletch at phydeaux.org
Sun Aug 26 23:06:37 EDT 2001
>>>>> "Gary" == Gary MacKay <Gary at EdisonInfo.com> writes:
Gary> Is there a quick way to rename all files in a directory to
Gary> lower case? Same filename, just rip through and make sure
Gary> they are all lowercase.
rename '$_=lc' *
rename '$_="\L$_"' *
rename 'y/A-Z/a-z/' *
---->8 rename 8<----
#!/usr/bin/perl -w
# rename - Larry's filename fixer
$op = shift or die "Usage: rename expr [files]\n";
chomp(@ARGV = <STDIN>) unless @ARGV;
for (@ARGV) {
$was = $_;
eval $op;
die $@ if $@;
rename($was,$_) unless $was eq $_;
}
---->8 rename 8<----
--
Fletch | "If you find my answers frightening, __`'/|
fletch at phydeaux.org | Vincent, you should cease askin' \ o.O'
770 933-0600 x211(w) | scary questions." -- Jules =(___)=
| U
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
More information about the Ale
mailing list