Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Echo message works without the space?

Aug
1,967
71
Code:
TCC  22.00.29 x64   Windows 7 [Version 6.1.7601]

This is not a bug, but I discovered something that is new to me, that is, certain characters can separate;
Code:
Echo message

If the environment variable %abc does not exist;
Code:
@setlocal
@echo off
echo %abc
echo.%abc
echo/%abc
echo:%abc
echo;%abc
echo"%abc
endlocal

With the exception of echo %abc all echo a blank line, instead of ECHO is OFF;
Code:
c:\users\jlc\utils>test
ECHO is OFF






c:\users\jlc\utils>
If %abc is set to a value;
Code:
@setlocal
@echo off
set abc=123
echo %abc
echo.%abc
echo/%abc
echo:%abc
echo;%abc
echo"%abc
endlocal
...the results are;
Code:
c:\users\jlc\utils>test[code]
123
123
123
123
123
123

This works all the way back to 4DOS 8.00

Joe
 
A few more:
Code:
v:\> echo+abc
abc

v:\> echo(abc
abc

v:\> echo\abc
abc
 
For compatibility with CMD.EXE, of course. Possibly even COMMAND.COM.
 
Back
Top
[FOX] Ultimate Translator
Translate