A bell code (sometimes bell character) is a device control code originally sent to ring a small electromechanical bell on stock ticker and other and teletypewriters to alert operators at the other end of the line, often of an incoming message. Though tickers punched the bell codes into their Ticker tape, printers generally do not print a character when the bell code is received. Bell codes are usually represented by the label "BEL". They have been used since 1870 (initially in Baudot code).
To maintain backward compatibility, video display terminals (VDTs) that replaced teletypewriters included speakers or buzzers to perform the same function, as did the personal computers that followed. Modern terminal emulators often integrate the warnings to the desktop environment (e.g., the Mac OS X Terminal will play the system warning sound) and also often offer a silent visual bell feature that flashes the terminal window briefly.
In the C programming language (created in 1972), the bell character can be placed in a string or character constant with \a. ('a' stands for "alert" or "audible" and was chosen because \b was already used for the backspace character.)
where the ^G is produced by holding down and typing . On Unix the user may need to type + first to "quote" the ^G.
On Linux one may also use:
echo -e "\a"
A program can get the same result by printing the BEL character to a terminal.
On modern systems this may not make a noise; it may instead make a visual indication such as flashing the screen, or do nothing at all.