SCP: Added expansion of special built-in environment variable DATE_YC which is the century of the current date.
This commit is contained in:
parent
cd9a499c94
commit
1f20041b58
2 changed files with 5 additions and 1 deletions
|
@ -237,7 +237,7 @@ The EXPECT command now exists to provide a means of reacting to simulator output
|
|||
#### Command Processing Enhancements
|
||||
|
||||
##### Environment variable insertion
|
||||
Built In variables %DATE%, %TIME%, %DATETIME%, %LDATE%, %LTIME%, %CTIME%, %DATE_YYYY%, %DATE_YY%, %DATE_MM%, %DATE_DD%, %DATE_D%, %DATE_WYYYY%, %DATE_WW%, %TIME_HH%, %TIME_MM%, %TIME_SS%, %STATUS%, %TSTATUS%, %SIM_VERIFY%, %SIM_QUIET%, %SIM_MESSAGE%
|
||||
Built In variables %DATE%, %TIME%, %DATETIME%, %LDATE%, %LTIME%, %CTIME%, %DATE_YYYY%, %DATE_YY%, %DATE_YC%, %DATE_MM%, %DATE_DD%, %DATE_D%, %DATE_WYYYY%, %DATE_WW%, %TIME_HH%, %TIME_MM%, %TIME_SS%, %STATUS%, %TSTATUS%, %SIM_VERIFY%, %SIM_QUIET%, %SIM_MESSAGE%
|
||||
Command Aliases
|
||||
|
||||
Token "%0" expands to the command file name.
|
||||
|
|
4
scp.c
4
scp.c
|
@ -2933,6 +2933,10 @@ for (; *ip && (op < oend); ) {
|
|||
strftime (rbuf, sizeof(rbuf), "%y", tmnow);
|
||||
ap = rbuf;
|
||||
}
|
||||
else if (!strcmp ("DATE_YC", gbuf)) {/* Century (year/100) */
|
||||
sprintf (rbuf, "%d", (tmnow->tm_year + 1900)/100);
|
||||
ap = rbuf;
|
||||
}
|
||||
else if (!strcmp ("DATE_MM", gbuf)) {/* Month number (01-12) */
|
||||
strftime (rbuf, sizeof(rbuf), "%m", tmnow);
|
||||
ap = rbuf;
|
||||
|
|
Loading…
Add table
Reference in a new issue