Stan Brown
2022-04-21 14:21:48 UTC
I have a batch file that contains these lines:
echo %%* = '%*' [%*] "%*"
echo %%*%% = '%*%' [%*%] "%*%"
echo %%$ = '%$' [%$] "%$"
I call the batch file in this way:
showargs a b "c=d" e
and those lines display the following:
%* = '*' [*] "a b "c=d" e"
%*% = '*' [*] "*"
%$ = 'a b "c=d" e' [a b "c=d" e] "a b "c=d" e"
In other words, in the first line, %* inside single quotes or
brackets returns the character *, _not_ the full command tail as
documented. "%*" does return the command tail, quoted.
Is this a bug, or are ' ' and [ ] around %* supposed to be special in
some way? As you can see, they are _not_ special around %$, but I
can't use %$ because the batch file uses SHIFT.
I have Windows version 10.0.19043.1645. the "ver" command in TCCLE
doesn't display anything, but %_4ver displays 12.10.
echo %%* = '%*' [%*] "%*"
echo %%*%% = '%*%' [%*%] "%*%"
echo %%$ = '%$' [%$] "%$"
I call the batch file in this way:
showargs a b "c=d" e
and those lines display the following:
%* = '*' [*] "a b "c=d" e"
%*% = '*' [*] "*"
%$ = 'a b "c=d" e' [a b "c=d" e] "a b "c=d" e"
In other words, in the first line, %* inside single quotes or
brackets returns the character *, _not_ the full command tail as
documented. "%*" does return the command tail, quoted.
Is this a bug, or are ' ' and [ ] around %* supposed to be special in
some way? As you can see, they are _not_ special around %$, but I
can't use %$ because the batch file uses SHIFT.
I have Windows version 10.0.19043.1645. the "ver" command in TCCLE
doesn't display anything, but %_4ver displays 12.10.
--
Stan Brown, Tehachapi, California, USA https://BrownMath.com/
Shikata ga nai...
Stan Brown, Tehachapi, California, USA https://BrownMath.com/
Shikata ga nai...