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

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.
 
M

Matthias Tacke

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
 
J

Jonathan

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.
 
A

Al Dunbar [MS-MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top