中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-27 05:51
47,812 topics / 349,912 posts / today 2 new / 48,264 members
其它操作系统综合讨论区 » What’s the difference between pressing Ctrl+A in CMD and directly typing ^A?
Printable Version  767 / 2
Floor1 dnawo Posted 2008-05-11 22:27
初级用户 Posts 13 Credits 38
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.
Floor2 lxmxn Posted 2008-05-12 00:40
版主 Posts 4,938 Credits 11,386
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 ]
Floor3 dnawo Posted 2008-05-12 01:24
初级用户 Posts 13 Credits 38
Got it, thank you
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023