End-of-Transmission character: Difference between revisions

Fixed up the unix description some
(Fixed up the unix description some)
{{Refimprove|date=August 2008}}In [[telecommunication]], an '''end-of-transmission character''' (EOT) is a [[transmission (telecommunications)|transmission]] [[control character]]. usedIt's intended use is to indicate the conclusion of a transmission that may have included one or more texts and any associated [[message]] headings.<ref name=1037c1996>{{cite web |url=http://www.its.bldrdoc.gov/fs-1037/dir-014/_2015.htm |title=end-of-transmission character (EOT) |work=[[Federal Standard 1037C]] |year=1996}}</ref>
 
An EOT is often used to initiate other functions, such as releasing circuits, disconnecting terminals, or placing receive terminals in a [[standby]] condition.<ref name=1037c1996/> InIt's [[Unix-like]]most systems,common theuse charactertoday is used to signalcause ana [[end-of-fileUnix]] when[[tty]] typingdriver atto asignal [[computerend terminal|terminalof file]] orand [[terminalthus emulator]]exit (theprograms equivalentthat toare theawaiting DOS [[control-Z]])input.{{Fact|date=March 2009}}
 
In [[UnicodeASCII]], theand [[hexadecimalUnicode]], the character with the codevalue number4 is '''0x04'''EOT. It can be referred to as control-D, '''<tt>^D'''</tt> in the [[caret notation]].{{Fact|date=March 2009}}
 
==Demonstration Meaning in Unix-based operating systems==
The 'End of Transmission' meaning of the control-D character can be shown with the cat program on [[Unix]]-based operating systems such as [[Linux]].
 
Commonly it is believed that <tt>^D</tt> is an end-of-file character in [[Unix-like]] systems, similar to the DOS [[control-Z]]. It's actual behavior is to cause the terminal driver to immediately make available any characters in the line buffer, and if the buffer is empty to switch to an end-of-file condition until it is reset. A <tt>^D</tt> in a file does not mean anything.
Run the <code>[[cat (Unix)|cat]]</code> command with no arguments, so that it accepts its input from your keyboard and prints output to your screen. Type a few characters without pressing Enter, then type control-D to indicate End of Transmission. The characters you have typed to that point are sent to cat, which then writes them to the screen. If you type control-D without typing any characters first, you terminate the input stream and the program ends.
 
This can be demonstrated with the cat program on [[Unix]]-based operating systems such as [[Linux]]: Run the <code>[[cat (Unix)|cat]]</code> command with no arguments, so that it accepts its input from your keyboard and prints output to your screen. Type a few characters without pressing Enter, then type control-{{keypress|Ctrl}}+{{keypress|D to indicate End of Transmission}}. The characters you have typed to that point are sent to cat, which then writes them to the screen. If you type control-{{keypress|Ctrl}}+{{keypress|D}} without typing any characters first, you terminate the input stream and the program ends. You may be able to get an actual <tt>^D</tt> by typing {{keypress|Ctrl}}+{{keypress|V}} and then {{keypress|Ctrl}}+{{keypress|D}}.
 
If the terminal is in "raw" mode then the <tt>^D</tt> character is sent unchanged to the program, which may decide to interpret it as ending the input. This is similar to how MSDOS works, where programs interpret the <tt>^Z</tt> character as ending the input.
 
==See also==