From: Colin Patrick Mccabe Date: Sun, 23 Sep 2012 22:51:24 +0000 (-0700) Subject: Add renamer.pl to rename files X-Git-Url: http://club.cc.cmu.edu/~cmccabe/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9d3d6b1c2f1cc215326d89c5286c76b9c3854c5;p=cmccabe-bin Add renamer.pl to rename files Signed-off-by: Colin McCabe --- diff --git a/renamer.pl b/renamer.pl new file mode 100755 index 0000000..93a0d37 --- /dev/null +++ b/renamer.pl @@ -0,0 +1,10 @@ +#!/usr/bin/perl + +$op = shift or die $help; +chomp(@ARGV = ) unless @ARGV; +for (@ARGV) { + $was = $_; + eval $op; + die $@ if $@; + rename($was,$_) unless $was eq $_; +}