cmd supports this bit of variable expansion in a `for` loop (from the `for /?` help):
tcc used to handle this construct the same way as cmd until v21. Here's a simple test script:
cmd and tcc through v20 process it the same:
But starting with tcc v21 the `%~I` construct expands to nothing:
Code:
%~I - expands %I removing any surrounding quotes (")
tcc used to handle this construct the same way as cmd until v21. Here's a simple test script:
Code:
C:\Program Files\JPSoft>type c:\temp\test.cmd
@echo off
for /f "usebackq" %%a IN ('test') do (
echo a is :%%a:
echo ~a is :%%~a:
)
for /f "usebackq" %%a IN ('"test2"') do (
echo a is :%%a:
echo ~a is :%%~a:
)
cmd and tcc through v20 process it the same:
Code:
C:\Program Files\JPSoft>ver
Microsoft Windows [Version 10.0.17134.765]
C:\Program Files\JPSoft>c:\temp\test.cmd
a is :test:
~a is :test:
a is :"test2":
~a is :test2:
C:\Program Files\JPSoft>TCMD20\tcc c:\temp\test.cmd
TCC 20.11.46 x64 Windows 10 [Version 6.3.17134]
Copyright 2017 JP Software Inc. All Rights Reserved
Your evaluation period expires in 30 days.
You can buy Take Command and TCC at https://jpsoft.com
a is :test:
~a is :test:
a is :"test2":
~a is :test2:
But starting with tcc v21 the `%~I` construct expands to nothing:
Code:
C:\Program Files\JPSoft>TCC_RT_21\tcc c:\temp\test.cmd
TCC-RT 21.01.63 x64 Windows 10 [Version 10.0.17134]
Copyright 2017 JP Software Inc. All Rights Reserved
a is :test:
~a is ::
a is :"test2":
~a is ::