Escape character

From Wikipedia, the free encyclopedia

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

In sh, the * character is special, expanding via globbing. In isolation, it expands to the names of all files in the current 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 *

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. 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).

  • 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.

Some of this article is based on material from Federal Standard 1037C.

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.

Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.