Add renamer.pl to rename files
authorColin Patrick Mccabe <cmccabe@alumni.cmu.edu>
Sun, 23 Sep 2012 22:51:24 +0000 (15:51 -0700)
committerColin Patrick Mccabe <cmccabe@alumni.cmu.edu>
Sun, 23 Sep 2012 22:51:24 +0000 (15:51 -0700)
Signed-off-by: Colin McCabe <cmccabe@alumni.cmu.edu>

renamer.pl [new file with mode: 0755]

diff --git a/renamer.pl b/renamer.pl
new file mode 100755 (executable)
index 0000000..93a0d37
--- /dev/null
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+
+$op = shift or die $help;
+chomp(@ARGV = <STDIN>) unless @ARGV;
+for (@ARGV) {
+    $was = $_;
+    eval $op;
+    die $@ if $@;
+    rename($was,$_) unless $was eq $_;
+}