- Mar
- 75
- 1
Consider this TCC v23.00.24 x64 session: (Discussion follows.)
The problem is that the echox internal command is interpreting everything in the command group except for the first echox, plus it is seeing command separators that were never injected except by TCC as part of its command grouping. This behavior violates the separation of functions that we programmers rely upon. I expect that if I invoke echox 3 times, then what is emitted to its output (however it is redirected or not) will be literally what followed on the 3 command tails, each followed by a newline.
Code:
[C:\Tmp]
> type load.btm && rem BTM script which can show echox funkiness with command grouping
@echo off
setlocal
iff _%1_==__ then
alias say=echo.
else
alias say=%1
endiff
iff _%2_==__ then
alias dowith=cat -
else
alias dowith=%@unquote[%2]%
endiff
(
say drop table if exists People;
say create table People( id, name );
say insert into People values (1,'Gonzo');
) | dowith
endlocal
[C:\Tmp]
> load && Rem Show the desired output (using echo. to do emits.)
drop table if exists People;
create table People( id, name );
insert into People values (1,'Gonzo');
[C:\Tmp]
> load echox && Rem Show messup with echox doing the emits.
drop table if exists People; &| say create table People( id, name ); &| say insert into People values (1,'Gonzo');
The problem is that the echox internal command is interpreting everything in the command group except for the first echox, plus it is seeing command separators that were never injected except by TCC as part of its command grouping. This behavior violates the separation of functions that we programmers rely upon. I expect that if I invoke echox 3 times, then what is emitted to its output (however it is redirected or not) will be literally what followed on the 3 command tails, each followed by a newline.