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-08-10 21:04
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Question about how to use ^ View 1,195 Replies 4
Original Poster Posted 2007-04-27 08:02 ·  新西兰
初级用户
Credits 107
Posts 47
Joined 2007-03-03 03:12
19-year member
UID 80618
Gender Male
Status Offline
I know how ^ is used, but I ran into a problem when I used it. With this line, echo echo 1 ^>1.txt >>2.bat, what shows up in 2.bat is echo 1 >1.txt But with this line, echo 1 ^>>1.txt >>2.bat, what shows up in 2.bat is actually echo 1 > I don't know why replacing > with >> makes it stop working. I searched the forum and didn't find any good answer, so I'd appreciate it if an expert could point it out.
Floor 2 Posted 2007-04-27 08:36 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 2,000
Posts 621
Joined 2007-01-01 00:00
19-year member
UID 75212
Gender Male
Status Offline
Floor 3 Posted 2007-04-27 08:37 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 2,000
Posts 621
Joined 2007-01-01 00:00
19-year member
UID 75212
Gender Male
Status Offline
You still haven't really understood the meaning of ^ as an escape symbol;

For special symbols like & ^ > < |, under certain circumstances you need to use ^ to escape them;

Each special symbol has to have a ^ added to escape it;

So something like >> should be written as ^>^> rather than ^>>
Floor 4 Posted 2007-04-27 17:25 ·  新西兰
初级用户
Credits 107
Posts 47
Joined 2007-03-03 03:12
19-year member
UID 80618
Gender Male
Status Offline
Thanks to the moderator for the reply, the problem has already been solved.
Floor 5 Posted 2008-12-03 21:26 ·  中国 福建 厦门 电信
新手上路
Credits 19
Posts 15
Joined 2008-03-31 01:01
18-year member
UID 114501
Gender Male
Status Offline
What characters can the ^ symbol cancel escaping for???
Can you list them all in detail???
Forum Jump: