Thanks penpen for the idea to test with the debug mode.
I tested it with
Code: Select all
echo ###1
echo(###2
echo (###3
echo[###4
echo=###5
I only show the relevant parts
output wrote:
Cmd: echo Type: 0 Args: ` ###1'
Cmd: echo Type: 0 Args: `(###2'
Cmd: echo Type: 0 Args: ` (###3'
Cmd: echo[###4 Type: 0
Cmd: echo Type: 0 Args: `=###5'
My conclusion is:
(like Dave) In phase2 the ( is a token delimiter lie ;,= and it's part of the argument.
But as even the plain echo ###1 the first character of the argument is a space, I suppose that the first character will be removed, always.
The only question left, is why echo(/? works but echo=/? fails, even the arguments looks quite the same.
The explanation is in PPS
jeb
PS: It seems that the most other command, can't work properly with any other delimiter than a space
IF works with the standard delimiter ;,= and space, but not with (
SET only removes trailing space, but SET,a=b sets the variable ",a" to "b"
PPS:
I suppose it's the ECHO parsing for /? that uses a quite different way than other commands.
It tests if the first "token" starts with "/?", then it shows the help.
But it strips all (standard) delimiters while it searches.
These varaiants all show the help
Code: Select all
echo /?
echo=/?
echo=/?
echo =;, /=,; ?
echo ;,/;=?TEXT
But it only strips the standard delimiters (,;= and space) therefore the "echo(" works so nicely