China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-31 22:26
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Closed]Why is the 1 lost when executing echo %%i %%j 1 >> ok.txt? View 5,542 Replies 22
Floor 16 Posted 2006-09-21 11:06 ·  中国 广东 佛山 广东睿江科技有限公司
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
Can double quotes also be used for escaping? How is the writing?
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 17 Posted 2006-09-21 11:12 ·  中国 湖南 娄底 电信
银牌会员
★★★
Credits 1,218
Posts 485
Joined 2006-07-21 21:24
20-year member
UID 58987
From 湖南.娄底
Status Offline
Using double quotes is not for escaping. It's just to enclose 0-9 with quotes to prevent the system from treating them as handles.
业精于勤而荒于嬉,形成于思而毁于随。
Floor 18 Posted 2006-09-21 11:30 ·  中国 广东 佛山 广东睿江科技有限公司
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
The method of enclosing 0-9 in quotes doesn't work, because the way of writing echo 123 "1">test.txt writes the string 123 "1" into test.txt, not the desired 123 1.
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 19 Posted 2006-09-22 07:45 ·  中国 甘肃 张掖 电信
金牌会员
★★★★
Credits 4,103
Posts 1,744
Joined 2006-01-20 13:00
20-year member
UID 49241
Gender Male
From 甘肃.临泽
Status Offline
Still writing like this is easy to understand >>ok.txt echo %%i %%j 1
Floor 20 Posted 2006-09-22 23:22 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
There is such a big knowledge in a simple ECHO?
Got to learn something new again~~~
:)
Floor 21 Posted 2008-01-02 17:27 ·  中国 广西 南宁 电信
初级用户
★★
Credits 127
Posts 59
Joined 2007-11-13 00:41
18-year member
UID 102491
Gender Female
Status Offline
>>text.txt echo 451563575 1
Still this kind is good, didn't expect there is such a way of writing. I endorse `^_^`
Floor 22 Posted 2008-01-02 21:31 ·  中国 广东 汕头 潮阳区 电信
高级用户
★★★
DOS时空
Credits 713
Posts 348
Joined 2007-02-10 13:59
19-year member
UID 79169
Gender Male
Status Offline
echo %%i %%j ^1 >>ok.txt
Floor 23 Posted 2008-10-15 21:37 ·  中国 江西 上饶 电信
初级用户
★★
Credits 193
Posts 98
Joined 2007-01-17 11:56
19-year member
UID 76803
Gender Male
Status Offline
I really didn't notice this situation, I need to read more materials in the future..
这家伙很聪明 什么都没留下
Forum Jump: