scripts

misc scripts and tools
git clone git://git.2f30.org/scripts.git
Log | Files | Refs

commit a072fe791ea61556f1a047e704a9ca600563734f
parent 2f5643522c2c11ebb7c449c56151b1c1154c6dfb
Author: haris <haris@metal.lan>
Date:   Sun Nov  3 18:42:02 +0200

rename script added

Diffstat:
rename | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/rename b/rename @@ -0,0 +1,11 @@ +#!/usr/bin/perl -w +# rename - Larry's filename fixer +# recursive renaming: `rename 's/one/two/g' */*` +$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 $_; +}