|
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.
ExamplesBourne shellIn 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 languagesMany 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. For example, 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
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 alsoThis article contains material from the Federal Standard 1037C, which, as a work of the United States Government, is in the public domain. |
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.
Mercedes Car
This site monitored by SitePinger.net