- Jul
- 442
- 6
I clearly don't understand how to use the ! (variable), based on how I read the docs.
" ! returns the last argument of the previous command. The command is retrieved from the history list, so this will not work in a batch file -- it's intended for aliases and command line work."
The following code blocks are being entered at the command line.
What am I doing wrong?
A second example just in case echo is a special case:
As 2 separate commands, no connecting & :
Using TCC 16.03.55 x64 yields different and confusing results.
" ! returns the last argument of the previous command. The command is retrieved from the history list, so this will not work in a batch file -- it's intended for aliases and command line work."
The following code blocks are being entered at the command line.
What am I doing wrong?
Code:
C:\JPSoft\TCMD17x64\logs>ver
TCC 17.00.53 x64 Windows 7 [Version 6.1.7601]
C:\JPSoft\TCMD17x64\logs>*dir /k /m tc16* & echo %!
11/16/2014 11:31 70,123 TC16_Nov_2014.log
10/17/2014 2:47 362,052 TC16_Oct_2014.log
!
A second example just in case echo is a special case:
Code:
C:\JPSoft\TCMD17x64\logs>
C:\JPSoft\TCMD17x64\logs>*dir /k /m tc16_nov_2014.log & *copy %! tc16_nov_2014Test.log
11/16/2014 11:30 70,001 TC16_Nov_2014.log
TCC: (Sys) The system cannot find the file specified.
"C:\JPSoft\TCMD17x64\logs\!"
0 files copied
As 2 separate commands, no connecting & :
Code:
C:\JPSoft\TCMD17x64\logs>*dir /k /m tc16_nov_2014.log
11/16/2014 11:46 70,938 TC16_Nov_2014.log
C:\JPSoft\TCMD17x64\logs>*dir /k /m %!
TCC: (Sys) The system cannot find the file specified.
"C:\JPSoft\TCMD17x64\logs\!"
Using TCC 16.03.55 x64 yields different and confusing results.
Code:
C:\JPSoft\TCMD16x64\logs>ver
TCC 16.03.55 x64 Windows 7 [Version 6.1.7601]
C:\JPSoft\TCMD16x64\logs>*dir /k /m tc16*
1/17/2014 1:18 224,499 TC16_Jan_2014.log
5/16/2014 23:27 5,280 TC16_May_2014.log
11/16/2014 12:26 25,066 TC16_Nov_2014.log
10/17/2014 2:47 54,604 TC16_Oct_2014.log
9/17/2014 10:53 57,421 TC16_Sep_2014.log
C:\JPSoft\TCMD16x64\logs>*dir /k /m %!
1/17/2014 1:18 224,499 TC16_Jan_2014.log
5/16/2014 23:27 5,280 TC16_May_2014.log
11/16/2014 12:26 25,112 TC16_Nov_2014.log
10/17/2014 2:47 54,604 TC16_Oct_2014.log
9/17/2014 10:53 57,421 TC16_Sep_2014.log
C:\JPSoft\TCMD16x64\logs>*dir /k /m tc16_jan_2014.log & *dir /k /m %!
1/17/2014 1:18 224,499 TC16_Jan_2014.log
TCC: Variable loop "%!"
C:\JPSoft\TCMD16x64\logs>*dir /k /m tc16_nov_2014.log
11/16/2014 12:29 25,345 TC16_Nov_2014.log
C:\JPSoft\TCMD16x64\logs>*dir /k /m tc16_may_2014.log & *dir /k /m %!
5/16/2014 23:27 5,280 TC16_May_2014.log
11/16/2014 12:30 25,502 TC16_Nov_2014.log
C:\JPSoft\TCMD16x64\logs>ver
TCC 16.03.55 x64 Windows 7 [Version 6.1.7601]
C:\JPSoft\TCMD16x64\logs>*dir /k /m tc16* & echo %!
1/17/2014 1:18 224,499 TC16_Jan_2014.log
5/16/2014 23:27 5,280 TC16_May_2014.log
11/16/2014 12:33 25,610 TC16_Nov_2014.log
10/17/2014 2:47 54,604 TC16_Oct_2014.log
9/17/2014 10:53 57,421 TC16_Sep_2014.log
TCC: Variable loop "%!"
C:\JPSoft\TCMD16x64\logs>*dir /k /m tc16_jan_2014*
1/17/2014 1:18 224,499 TC16_Jan_2014.log
C:\JPSoft\TCMD16x64\logs>echo %!
tc16_jan_2014*