diff --git a/README.md b/README.md index 2bbd9817..7644b355 100644 --- a/README.md +++ b/README.md @@ -212,7 +212,7 @@ The "!" command (execute a command on the local OS), now returns the command's e #### Command Processing Enhancements ##### Environment variable insertion -Built In variables %DATE%, %TIME%, %CTIME%, %STATUS%, %TSTATUS%, %SIM_VERIFY%, %SIM_QUIET%, %SIM_MESSAGE% +Built In variables %DATE%, %TIME%, %STIME%, %CTIME%, %STATUS%, %TSTATUS%, %SIM_VERIFY%, %SIM_QUIET%, %SIM_MESSAGE% Command Aliases Token "%0" expands to the command file name. @@ -228,8 +228,9 @@ Command Aliases variables, and if one isn't found then can be one of several special variables: - %DATE% yyyy/mm/dd + %DATE% yyyy-mm-dd %TIME% hh:mm:ss + %STIME% hh_mm_ss %CTIME% Www Mmm dd hh:mm:ss yyyy %STATUS% Status value from the last command executed %TSTATUS% The text form of the last status value diff --git a/scp.c b/scp.c index e377eba6..686328d9 100644 --- a/scp.c +++ b/scp.c @@ -1758,8 +1758,9 @@ return stat | SCPE_NOMESSAGE; /* suppress message sinc A Tokens preceeded and followed by % characters are expanded as environment variables, and if one isn't found then can be one of several special variables: - %DATE% yyyy/mm/dd + %DATE% yyyy-mm-dd %TIME% hh:mm:ss + %STIME% hh_mm_ss %CTIME% Www Mmm dd hh:mm:ss yyyy %STATUS% Status value from the last command executed %TSTATUS% The text form of the last status value @@ -1847,13 +1848,17 @@ for (; *ip && (op < oend); ) { time(&now); tmnow = localtime(&now); if (!strcmp ("DATE", gbuf)) { - sprintf (rbuf, "%4d/%02d/%02d", tmnow->tm_year+1900, tmnow->tm_mon+1, tmnow->tm_mday); + sprintf (rbuf, "%4d-%02d-%02d", tmnow->tm_year+1900, tmnow->tm_mon+1, tmnow->tm_mday); ap = rbuf; } else if (!strcmp ("TIME", gbuf)) { sprintf (rbuf, "%02d:%02d:%02d", tmnow->tm_hour, tmnow->tm_min, tmnow->tm_sec); ap = rbuf; } + else if (!strcmp ("STIME", gbuf)) { + sprintf (rbuf, "%02d_%02d_%02d", tmnow->tm_hour, tmnow->tm_min, tmnow->tm_sec); + ap = rbuf; + } else if (!strcmp ("CTIME", gbuf)) { strcpy (rbuf, ctime(&now)); rbuf[strlen (rbuf)-1] = '\0'; /* remove trailing \n */