Quote
OMG Geeky Nerds!!!!!!!!!!!!!!!!!!
who has read the whole thread here?
Posted 13 April 2005 - 08:36 PM
Posted 13 April 2005 - 10:49 PM
Posted 07 April 2007 - 08:30 PM
#!/bin/bash
CMD="urbanterror"
PROT="68"
DIR="$HOME/.q3a/q3ut4/demos"
ln -sf $1 "$DIR/LATESTREPLAY.dm_$PROT"
$CMD +demo "LATESTREPLAY.dm_$PROT"
Posted 08 April 2007 - 03:25 AM
#!/usr/bin/perl -w
# Script to rename demo files on Linux.
# It should be an all upper case name before the lower case ".dm_68" at the end.
use strict;
use warnings;
use Fatal qw(opendir closedir);
my $dir = "$ENV{HOME}/.q3a/q3ut4/demos";
opendir(my $dir_handle, $dir);
while (my $entry = readdir($dir_handle)) {
# Only look at files that should be renamed (skip properly named)
if (-f "$dir/$entry" && $entry =~ /^(.*[a-z]+.*)(.dm_68)$/) {
my $new_name = uc($1) . $2;
print "Renaming $dir/$entry to $dir/$new_namen";
rename "$dir/$entry", "$dir/$new_name";
}
}
closedir($dir_handle);