[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] quick way to rename all files ?
- Subject: [ale] quick way to rename all files ?
- From: fletch at phydeaux.org (Fletch)
- Date: 26 Aug 2001 23:06:37 -0400
>>>>> "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.