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-27 03:51
中国DOS联盟论坛 » 其它操作系统综合讨论区 » What’s the difference between pressing Ctrl+A in CMD and directly typing ^A? View 765 Replies 2
Original Poster Posted 2008-05-11 22:27 ·  中国 福建 福州 电信
初级用户
Credits 38
Posts 13
Joined 2008-04-24 14:16
18-year member
UID 116814
Gender Male
Status Offline
In CMD, if I enter "echo ^A" (here ^A comes from pressing Ctrl+A), it displays ☺, but if I type "echo ^A" on the keyboard, it displays A. I don’t know what the difference is between the two.
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
+1 2008-05-12 08:43
leonlau +2 2008-09-29 16:45
Floor 2 Posted 2008-05-12 00:40 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
Ctrl+A actually represents the character with ASCII value 1, so it displays as ☺. The “^A” shown on the screen here is just a form of representation.

By the same logic, Ctrl+B represents the character with ASCII value 2...

And if you directly type the two characters “^A” on the keyboard, what gets displayed is the A character after escaping, and A is not a special character, so it still displays as “A”.

If you understand this principle, then try Ctrl+M and you’ll understand why it can execute the command you entered.

[ Last edited by lxmxn on 2008-5-12 at 12:41 AM ]
Floor 3 Posted 2008-05-12 01:24 ·  中国 福建 福州 电信
初级用户
Credits 38
Posts 13
Joined 2008-04-24 14:16
18-year member
UID 116814
Gender Male
Status Offline
Got it, thank you
Forum Jump: