Created
December 9, 2008 19:35
-
-
Save jgornick/34051 to your computer and use it in GitHub Desktop.
Terminal Perl Based Rename Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
# rename | |
$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 $_; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment