[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] mv *.JPG *.jpg
- Subject: [ale] mv *.JPG *.jpg
- From: fletch at phydeaux.org (Fletch)
- Date: 17 Dec 2002 16:41:26 -0500
>>>>> "Christopher" == Christopher Bergeron <christopher at bergeron.com> writes:
Christopher> Does anyone know how I can do this: mv *.JPG *.jpg
Christopher> ???
Christopher> I can do it in DOS; but I haven't been able to figure
Christopher> out how to do it in linux yet. Anyone have any
Christopher> suggestions?
rename 's/\.JP(E?)G$/.jp\l$1\Eg/' *.JPG *.JPEG
#!/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 $_;
}
__END__
--
Fletch | "If you find my answers frightening, __`'/|
fletch at phydeaux.org | Vincent, you should cease askin' \ o.O'
770 294-0820 (m) | scary questions." -- Jules =(___)=
| U
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale