My hypothesis for that behaviour was,that CR could be a not escapable character, which just ends the actual token (and starts a new one).
Then i saw the "echo #5 example"... .
Code: Select all
echo #5: 3 is ... part of redirect 4>NUL -^
%$CR%3>&2 END
The minus-char is ignored, but i think that has only todo with the placement between the two redirections, so i tested that and some other characters:
Code: Select all
echo on
echo #5.1: 3 is ... part of redirect 4>NUL ,,,,,,,,,,,,,,,,,,,------------^
3>&2 END
echo #5.2: 3 is ... part of redirect 4>NUL ------------^
3>&2 END
echo #5.3: 3 is ... part of redirect 4>NUL ,,,,,,,,,,,,,,,,,,,^
3>&2 END
echo #5.4: 3 is not part of redirect 4>NUL ------------,,,,,,,,,,,,,,,,,,,^
3>&2 END
echo #5.5: 3 is ... part of redirect 4>NUL ===;;;,,,...!!!(((aaaZZZ)))---[[[]]]{{{}}}'''+++```~~~^
3>&2 END
Result:
Code: Select all
#echo #5.1: 3 is ... part of redirect END 4>NUL 3>&2
#5.1: 3 is ... part of redirect END
#echo #5.2: 3 is ... part of redirect END 4>NUL 3>&2
#5.2: 3 is ... part of redirect END
#echo #5.3: 3 is ... part of redirect END 4>NUL 3>&2
#5.3: 3 is ... part of redirect END
#echo #5.4: 3 is not part of redirect ------------,,,,,,,,,,,,,,,,,,,3 END 4>NUL 1>&2
#5.4: 3 is ... part of redirect ------------,,,,,,,,,,,,,,,,,,,3 END
#echo #5.5: 3 is ... part of redirect END 4>NUL 3>&2
#5.5: 3 is ... part of redirect END
Some kind of funny that the order of the used special characters does matter... .
I'm unsure if a single additional (mini) tokenizer could cause something like that... .
(I have the strange feeling, that i've seen that behaviour before... somewhere.)
penpen
Edit: Added as many (representative characters to the echo 5.5 as possible.