differences between : 'echo toto' and 'echo/toto'

  • Thread starter Thread starter Jonathan
  • Start date Start date
J

Jonathan

Hi,

What is the difference between these two lines :

:::::::::::::::::::::::::::::::::::::
c:\>echo toto
toto

c:\>
:::::::::::::::::::::::::::::::::::::

AND

:::::::::::::::::::::::::::::::::::::
c:\>echo/toto
toto

c:\>
:::::::::::::::::::::::::::::::::::::

What is the signification of slash character in the second example ?
The result is the same..... I don't understand....
A lot of scripts used it !
What does it mean ?

thx for all ;)

J.
 
Jonathan said:
What is the signification of slash character in the second example ?
The result is the same..... I don't understand....
A lot of scripts used it !
What does it mean ?
Both are valid delimiters. The space is problematic in cases you only
echo a probaply empty variable. In that case echo would result in
echo status being reported instead of an empty line.

There are other valid delimiters like .:\ but among them the slash
is one of the faster.

HTH
 
Matthias Tacke a écrit :
Both are valid delimiters. The space is problematic in cases you only
echo a probaply empty variable. In that case echo would result in
echo status being reported instead of an empty line.

There are other valid delimiters like .:\ but among them the slash
is one of the faster.

Thanx a lot for yours explanations.
It's just for batch files. On the cmdline, it's not the same thing.

I will sleep less stupid this evening ;)

J.
 
Jonathan said:
Matthias Tacke a écrit :

Thanx a lot for yours explanations.
It's just for batch files. On the cmdline, it's not the same thing.

ECHO doesn't work *exactly* the same on the cmdline, however, I always use
the "/" for all ECHO output, and this command:

echo/

works exactly the same in a batch file as on the cmdline, namely to print a
blank line.

More apropos here is the fact that, at the cmdline, there are very few
reasons to use the ECHO command.
I will sleep less stupid this evening ;)

Sweet dreams!

/Al
 
Back
Top