- May
- 3,515
- 5
It seems that under many circumstances the parser considers a period
embedded in the name of an environment variable as a name terminator. Some
instances I found are:
[c:]set setcolor.lst=aa bb cc
[c:]set setcolor=xxx
1/ using the VariableExpand key in the command line
[c:]xyz %setcolor.lst
displays
[c:]xyz xxx.lst
2/ ECHO
[c:]echo %setcolor.lst
xxx.lst
3/ In a batch file the command
do %x in /l %setcolor.lst
echo %x
enddo
displays .lst
IF DEFINED works correctly, i.e., if SETCOLOR is not defined, IF DEFINED
SETCOLOR.LST is true.
The behavior goes back at least to V6. I never observed it, because I only
use a few such variable names, and those only with IF DEFINED tests (not
counting executable extensions).
--
Steve
embedded in the name of an environment variable as a name terminator. Some
instances I found are:
[c:]set setcolor.lst=aa bb cc
[c:]set setcolor=xxx
1/ using the VariableExpand key in the command line
[c:]xyz %setcolor.lst
displays
[c:]xyz xxx.lst
2/ ECHO
[c:]echo %setcolor.lst
xxx.lst
3/ In a batch file the command
do %x in /l %setcolor.lst
echo %x
enddo
displays .lst
IF DEFINED works correctly, i.e., if SETCOLOR is not defined, IF DEFINED
SETCOLOR.LST is true.
The behavior goes back at least to V6. I never observed it, because I only
use a few such variable names, and those only with IF DEFINED tests (not
counting executable extensions).
--
Steve