# ECHO bug

#### Roedy

echo "[!-- macro Moved reunion/reunion.html --]" ] E:\mindprod\reunion\index.html

Angle brackets are shown as square brackets.

Puts the text in the index.html but also the surrounding quotes.

I did not notice this before because I used my own MASM Echo-like utility that stopped working with Windows 7.

If you figure it is too late now to fix this, please warn folks in the documentation.

#### Jim Cook

I've had issues with that before. Somehow the quoting behavior in ECHO more
often surprises me than in other commands. I believe that using back quotes
has always worked for me. This assumes you can change your source.

echo `[!-- macro Moved reunion/reunion.html --]` ]
E:\mindprod\reunion\index.html

On Thu, Jan 28, 2010 at 6:54 AM, Roedy <> wrote:

> echo "[!-- macro Moved reunion/reunion.html --]" ]
> E:\mindprod\reunion\index.html
>
> Angle brackets are shown as square brackets.
>
> Puts the text in the index.html but *also* the surrounding quotes.
>
> I did not notice this before because I used my own MASM Echo-like utility
> that stopped working with Windows 7.
>
> If you figure it is too late now to fix this, please warn folks in the
> documentation.
>
>
>
>
>

--
Jim Cook
2010 Sundays: 4/4, 6/6, 8/8, 10/10, 12/12 and 5/9, 9/5, 7/11, 11/7.
Next year they're Monday.

#### Steve Fabian

Roedy wrote:
| echo "[!-- macro Moved reunion/reunion.html --]" ]
| E:\mindprod\reunion\index.html
|
| Angle brackets are shown as square brackets.

Do you mean in your example above you used braces "[]" where the command had
angle brackets "<>"?

| Puts the text in the index.html but *also* the surrounding quotes.

AFAIK it has worked that way even in 4DOS. If you use the accent grave (also
known as back-tick, `) to quote the text you will observe what you
apparently desire, i.e. the command below (using your angle bracket to brace
substitution)

echo `[!-- macro Moved reunion/reunion.html --]` ]
E:\mindprod\reunion\index.html

will store

[!-- macro Moved reunion/reunion.html --]

in the target file. Note that any character other than the ` character
itself is written to the target without interpretation.

Another method of writing text containing characters meaningful to the
parser is the use of the TEXT command:

TEXT ] E:\mindprod\reunion\index.html
[!-- macro Moved reunion/reunion.html --]
ENDTEXT

--
HTH, Steve

#### vefatica

Those characters could also be escaped with ^.

And their special meaning can be turned off with SETDOS /X-6.

On Thu, 28 Jan 2010 10:28:22 -0500, Steve Fábián <> wrote:

|Roedy wrote:
|| echo "[!-- macro Moved reunion/reunion.html --]" ]
|| E:\mindprod\reunion\index.html
||
|| Angle brackets are shown as square brackets.
|
|Do you mean in your example above you used braces "[]" where the command had
|angle brackets "<>"?
|
|| Puts the text in the index.html but *also* the surrounding quotes.
|
|AFAIK it has worked that way even in 4DOS. If you use the accent grave (also
|known as back-tick, `) to quote the text you will observe what you
|apparently desire, i.e. the command below (using your angle bracket to brace
|substitution)
|
|echo `[!-- macro Moved reunion/reunion.html --]` ]
|E:\mindprod\reunion\index.html
|
|will store
|
|[!-- macro Moved reunion/reunion.html --]
|
|in the target file. Note that any character other than the ` character
|itself is written to the target without interpretation.
|
|Another method of writing text containing characters meaningful to the
|parser is the use of the TEXT command:
|
|TEXT ] E:\mindprod\reunion\index.html
|[!-- macro Moved reunion/reunion.html --]
|ENDTEXT
--
- Vince

#### rconn

> echo "[!-- macro Moved reunion/reunion.html --]" ]
> E:\mindprod\reunion\index.html
>
> Angle brackets are shown as square brackets.
>
> Puts the text in the index.html but *also* the surrounding quotes.
>
> I did not notice this before because I used my own MASM Echo-like
> utility that stopped working with Windows 7.
>
> If you figure it is too late now to fix this, please warn folks in the
> documentation.

This is WAD; definitely *not* a bug. (It's also exactly how CMD.EXE
behaves.)

Did you expect ECHO would remove double quotes? (If so, why?)

Replies
6
Views
436
Replies
2
Views
229
Replies
2
Views
466
Replies
2
Views
859
Replies
6
Views
2K
Replies
6
Views
1K
Replies
2
Views
956
Replies
12
Views
2K
Replies
3
Views
992
Replies
4
Views
1K
How to? ^C echo
Replies
6
Views
2K
Replies
9
Views
1K
Replies
7
Views
2K
Replies
8
Views
5K
Replies
1
Views
4K
Replies
3
Views
1K
Replies
16
Views
5K
Replies
1
Views
1K
Replies
2
Views
2K
Replies
9
Views
2K
Replies
3
Views
2K
Replies
4
Views
3K
Replies
1
Views
329
Replies
0
Views
234
Replies
5
Views
406
Replies
7
Views
559
Replies
2
Views
914
Replies
14
Views
1K
Replies
6
Views
692
Replies
8
Views
726
Replies
1
Views
575
Replies
6
Views
1K
Replies
2
Views
795
Replies
7
Views
1K
Replies
3
Views
1K
Replies
6
Views
1K
Replies
11
Views
2K
Replies
2
Views
1K
Replies
4
Views
2K
Replies
4
Views
1K
Replies
6
Views
1K
Replies
2
Views
1K
Replies
2
Views
1K
Replies
6
Views
1K
Replies
4
Views
1K
Replies
1
Views
1K
Replies
3
Views
1K
Replies
6
Views
2K
Replies
7
Views
2K
Replies
4
Views
1K