I'm a perl n00b so please improve it if you can and I'll update this message. Thanks.
uhm, the first thing I would improve if I took the time for it, is to make it more "forgiving" to unrelated file/dirnames if run for totally unrelated files, so be carefull with it as it is now and do not run it as "./script /*". :-)
instructions:
1. paste it to an empty file
2. It would run with "perl file" (or "./file" if "chmod +x file" is run)
3. cd to ~/.q3a/q3ut3/demos
4. It is NOT forgiving so it doesn't do anything by itself, a "glob" should be given, e.g. "./script *68" or "./script 2005_20_1_7_21_2_FS_UT_ABBEY2_TDM.dm_68"
5. Since it is not forgiving it will rename unrelated files/dirs to weird names like "dm_68" if used with a "*", so be carefull.
#!/usr/bin/perl -w
use strict;
for (@ARGV) {
print "renaming $_n";
m/(.*.)(.*)/;
my $new1 = uc($1);
my $new_name = $new1."dm_68";
print " to $new_namen";
rename $_, $new_name;
}
example:
$ ./script 2005_16_0_9_22_*
renaming 2005_16_0_9_22_19_fs_jumpit_FFA.dm_68
to 2005_16_0_9_22_19_FS_JUMPIT_FFA.dm_68
renaming 2005_16_0_9_22_40_fs_jumpit_FFA.dm_68
to 2005_16_0_9_22_40_FS_JUMPIT_FFA.dm_68
$