Welcome!

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

SignUp Now!

Does TCC improve CMD's implementation of ECHO?

Apr
318
7
An ECHO command immediately followed by a dot, is commonly used to output an empty line. I read on StackExchange that under CMD that triggers a search for a file? The advice given was to use (almost) any *but* the dot. Does TCC have the same issue? If so, what is the preferred method of typing an empty line?
 
From https://ss64.com/nt/echo.html

Echo a blank line

Code:
The following in a batch file will produce an empty line:
Echo.
or
Echo:
The second option is better, because Echo. will search for a file named "echo" if this file does not exist the command does work, but this makes it slower than echo(

Joe
 
Sure enough. How odd.

Code:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\>echo.


C:\>copy con echo
Test!^Z
        1 file(s) copied.

C:\>echo.
'echo.' is not recognized as an internal or external command,
operable program or batch file.

C:\>del echo

C:\>echo.


C:\>
 
ECHO in TCC does not trigger a search for a file. I'm not aware of it doing that under CMD either -- do you have a link to that thread on StackExchange?

That was https://stackoverflow.com/questions/132799/how-can-you-echo-a-newline-in-batch-files?rq=1

Some very creative code, must say,... if you're looking for test-cases to test TCC's compatibility with CMD.

So - just to be clear - there is no difference in performance then, triggered by the actual character following the ECHO command in TCC?
 

Similar threads

Back
Top