> Actually there is a perl 'rename' program in many packages --I suggest to
> read the documentation of it and decide for yourself how 'friendly'
> it'susage seems to you :-) // i.e. I do read documentations
I've been using the Perl rename program that Horst is alluding to for
some time now and it does most things I need it to do. One feature
that I did add in my own version of the script (attached below) is
a "-n" switch to have the script tell me what it would do with my
arguments, but not actually do the renaming. This allows me to test
my syntax before actually changing any file names.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Hal Pomeranz, Founder/CEO Deer Run Associates [EMAIL PROTECTED]
Network Connectivity and Security, Systems Management, Training
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#!/usr/bin/perl
$testmode = 0;
if ($ARGV[0] eq '-n') {
shift(@ARGV);
$testmode = 1;
}
($op = shift @ARGV) || die 'Usage: $0 [-n] expr [file ...]\n';
if ([EMAIL PROTECTED]) {
@ARGV = <STDIN>;
chop(@ARGV);
}
for (@ARGV) {
$was = $_;
eval $op;
die $@ if $@;
if ($testmode) { print "rename($was, $_)\n"; }
else { rename($was, $_) unless ($was eq $_); }
}
_______________________________________________
EUGLUG mailing list
[EMAIL PROTECTED]
http://www.euglug.org/mailman/listinfo/euglug