Usually when I find something weird in TCC/4NT, it's some kind of CMD compatibility. But, I can't see how this could be intentional! I have repro'd in both TCC LE 13.00. 09 and 11.00.40. We are long-time 4NT users here at our shop.
I have made a very simple repro case for this. The assignment to EXAMPLE_VAR inside the block seems to have no effect when multiple TEEs are used on the echo statement.
As you might imagine, this code originally was meaningful and wasn't TEEing to the NUL device!
------------------------------------------------------
Batch file:
@echo off
set EXAMPLE_VAR=0
(
echo This line uses TEE | tee /a nul | tee nul
set EXAMPLE_VAR=1
)
echo After block: EXAMPLE_VAR = %EXAMPLE_VAR
---------------------------------------------------------
Output:
This line uses TEE
After block: EXAMPLE_VAR = 0
I have made a very simple repro case for this. The assignment to EXAMPLE_VAR inside the block seems to have no effect when multiple TEEs are used on the echo statement.
As you might imagine, this code originally was meaningful and wasn't TEEing to the NUL device!
------------------------------------------------------
Batch file:
@echo off
set EXAMPLE_VAR=0
(
echo This line uses TEE | tee /a nul | tee nul
set EXAMPLE_VAR=1
)
echo After block: EXAMPLE_VAR = %EXAMPLE_VAR
---------------------------------------------------------
Output:
This line uses TEE
After block: EXAMPLE_VAR = 0