[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] GRRRRRR .... Regular expressions .....
find foo -type f -name '*.php3' | xargs rename.pl 's/\.php3$/.php/'
#!/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 $_;
}
--
Fletch | "If you find my answers frightening, __`'/|
fletch at phydeaux.org | Vincent, you should cease askin' \ o.O'
| scary questions." -- Jules =(___)=
| U