diff --git a/tsshbatch.py b/tsshbatch.py index 49538a2..031bd9e 100755 --- a/tsshbatch.py +++ b/tsshbatch.py @@ -20,7 +20,7 @@ CMDINCL = PROGENV + "CMDS" HOSTINCL = PROGENV + "HOSTS" -CVSID = "$Id: tsshbatch.py,v 1.194 2014/12/03 19:12:07 tundra Exp $" +CVSID = "$Id: tsshbatch.py,v 1.195 2014/12/03 19:37:40 tundra Exp $" VERSION = CVSID.split()[2] CPRT = "(c)" DATE = "2011-2014" @@ -53,6 +53,7 @@ import shlex import socket import sys +import time ##### @@ -126,11 +127,13 @@ # Builtin Symbols ##### +DATE = '__DATE__' HOSTNAME = '__HOSTNAME__' HOSTNUM = '__HOSTNUM__' HOSTSHORT = '__HOSTSHORT__' +TIME = '__TIME__' -BuiltIns = (HOSTNAME, HOSTNUM, HOSTSHORT) +BuiltIns = (DATE, HOSTNAME, HOSTNUM, HOSTSHORT, TIME) ##### # Global Symbol Table @@ -905,9 +908,12 @@ # That way, both user-defined and builtin symbols will # subsequently be substituted. - internals = [(HOSTNAME, host), + internals = [ + (DATE, time.strftime("%Y%m%d")), + (HOSTNAME, host), (HOSTNUM, str(hostnum)), (HOSTSHORT, host.split('.')[0]), + (TIME, time.strftime("%H%M%S")), ] # Install builtins in the symbol table but only if the