At the command prompt in Windows, I can echo a bell character by typing echo
and then holding down Ctrl+G to produce echo ^G
, and it will make a bell noise when I run it.
When I actually type echo ^G
with my keyboard, it will only print G
onto the screen and not make any noise.
Can someone explain this?
Thanks
Select Start > All Programs > Accessories > Command Prompt. In the command window that opens, enter echo %VARIABLE%. Replace VARIABLE with the name of the environment variable. For example, to check if NUKE_DISK_CACHE is set, enter echo %NUKE_DISK_CACHE%.
In Windows, you can type any character you want by holding down the ALT key, typing a sequence of numbers, then releasing the ALT key.
In computing, echo is a command that outputs the strings that are passed to it as arguments. It is a command available in various operating system shells and typically used in shell scripts and batch files to output status text to the screen or a computer file, or as a source part of a pipeline. echo.
The ^G in the first case is supposed to represent one character which is the Ctrl-G character.
When you are typing ^G you are typing two characters and they are interpreted as two characters.
However the command line treats ^ as a special character to let it know that the next character is to be treated literally, so it is not actually displayed on the screen, so you just see the G.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With