[ale] mv *.JPG *.jpg

Fletch fletch at phydeaux.org
Tue Dec 17 16:41:26 EST 2002


>>>>> "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






More information about the Ale mailing list