"Set" command behavior - a bug?

Feb 27, 2018
11
0
The documentation says:

If you enter only name, and there is no variable with that name, SET will display all environment variables whose names begin with name. For example, if there is no variable pa, the command below will display all variables whose names start with pa:

set pa

The above command is equivalent to the command

set pa*

Here is the batch file to test this:

set var1=var1
set var11=var11
set var1


The TCC output:
1524221939034.png


The cmd.exe output:
1524222136140.png


Does it look like a bug?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,688
106
Albuquerque, NM
prospero.unm.edu
TCC's behavior matches the documentation, so I would say no. More like a deliberate incompatibility.

(I'm guessing, but this behavior may go back to 4DOS, predating CMD.EXE.)
 
Aug 23, 2010
688
9
If you want to see the contents of a variable, use echo.
"Set" is to SET the variable.
All other behavior is undefined and cannot be relied upon across various shells.
 

Similar threads

Replies
4
Views
2K