This MedLibrary.org supplementary page on Escape character is provided directly from the open source Wikipedia as a service to our readers. Please see the note below on authorship of this content, as well as the Wikipedia usage guidelines. To search for other content from our encyclopedia supplement, please use the form below:
Related Sponsors
In computing and telecommunication, an escape character is a single character which in a sequence of characters signifies that what is to follow takes an alternative interpretation. The term escape sequence refers to the escape character and the subsequent character or characters so modified.
Contents |
Examples
Bourne shell
In sh, the * character is a wildcard character, expanding via globbing. In isolation, it expands to the names of all files in the working directory. So to refer to a file literally called * you need to tell the shell to not interpret it in this way, which you do by preceding it with a backslash (\) -- this escapes the * character. Compare:
rm *
# delete all files in the current directory
rm \*
# delete the file named *
Programming languages
Many modern programming languages specify the doublequote character (") as a delimiter for a string literal. The backslash escape character provides one way to include doublequotes inside a string literal.
In Perl
In Perl:
print "Nancy said "Hello World!" to the crowd.";
produces a syntax error, whereas:
print "Nancy said \"Hello World!\" to the crowd.";
produces the intended output.
Some programming languages also provide other ways to prevent this type of error, without requiring an escape character (see e.g. delimiter collision).
Categories
- In alphabet coding schemes, a specially designated character, the occurrence of which in the data signifies that one or more of the characters to follow are from a different character code, i.e., have meanings other than normal.
- In a text-control sequence of characters, a control character that indicates the beginning of the sequence and the end of any preceding text. This is for instance used to control text terminals and printers (see escape sequence).
- In the ASCII character code, the character ESC with decimal code 27 and hexadecimal code 1B.
Early reference to this term is found in Bob Bemer's IBM technical publications.
The Escape key is usually found on standard PC keyboards. However it is commonly absent from keyboards for PDAs and other devices not designed primarily for ASCII communications, and not generally used as part of the common user interface for applications on the Windows operating system. The DEC VT220 series was one of the few popular keyboards that did not have a dedicated Esc key, instead using one of the keys above the main keypad, though it is debatable if this contributed to the failure of the DEC personal computer series that used this keyboard.
External links
See also
This article contains material from the Federal Standard 1037C, which, as a work of the United States Government, is in the public domain.
Wikipedia content modification information:
- This page was last modified on 7 November 2008, at 01:38.
Wikipedia Authorship and Review
Wikipedia content provided here is not reviewed directly by MedLibrary.org. Wikipedia content is authored by an open community of volunteers and is not produced by or in any way affiliated with MedLibrary.org.
Wikipedia Usage Guidelines
This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article on "Escape character".
The URL for this specific entry is:
All Wikipedia text is available under the terms of the GNU Free Documentation License. (See Copyrights for details). Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc.
