Jump to content

Backslash: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
No edit summary
Tag: possible vandalism
Line 1: Line 1:
{{punctuation marks|\}}
{{punctuation marks|\}}
The '''backslash''' ('''/''') is a typographical mark ([[glyph]]) used chiefly in [[computing]]. It was first introduced to computers in 1960 by [[Bob Bemer]].<ref>[http://www.thocp.net/biographies/bemer_bob.htm Mini-Biography of Bob Bemer]</ref> Sometimes called a '''reverse solidus''' or a '''slosh''', it is the mirror image of the common [[slash (punctuation)|slash]].<ref>''[[Macquarie Dictionary]]'' (3rd edition)</ref>
The '''backslash''' ('''8====D[[Special:Contributions/65.44.114.153|65.44.114.153]] ([[User talk:65.44.114.153|talk]]) 17:59, 26 September 2010 (UTC)''') is a typographical mark ([[glyph]]) used chiefly in [[computing]]. It was first introduced to computers in 1960 by [[Bob Bemer]].<ref>[http://www.thocp.net/biographies/bemer_bob.htm Mini-Biography of Bob Bemer]</ref> Sometimes called a '''reverse solidus''' or a '''slosh''', it is the mirror image of the common [[slash (punctuation)|slash]].<ref>''[[Macquarie Dictionary]]'' (3rd edition)</ref>


Other common terms for the character include hack, [[escape character|escape]] (from [[C (programming language)|C]]/[[UNIX]]), reverse slash, backslant, and backwhack. Also, it is sometimes referred as bash, reverse slant, reversed virgule, or backslat.<ref>{{cite web | url=http://www.catb.org/jargon/html/A/ASCII.html | title=ASCII | last=Raymond | first=Eric S}}</ref>
Other common terms for the character include hack, [[escape character|escape]] (from [[C (programming language)|C]]/[[UNIX]]), reverse slash, backslant, and backwhack. Also, it is sometimes referred as bash, reverse slant, reversed virgule, or backslat.<ref>{{cite web | url=http://www.catb.org/jargon/html/A/ASCII.html | title=ASCII | last=Raymond | first=Eric S}}</ref>

Revision as of 17:59, 26 September 2010

The backslash (8====D65.44.114.153 (talk) 17:59, 26 September 2010 (UTC)) is a typographical mark (glyph) used chiefly in computing. It was first introduced to computers in 1960 by Bob Bemer.[1] Sometimes called a reverse solidus or a slosh, it is the mirror image of the common slash.[2]

Other common terms for the character include hack, escape (from C/UNIX), reverse slash, backslant, and backwhack. Also, it is sometimes referred as bash, reverse slant, reversed virgule, or backslat.[3]

Usage

Bob Bemer introduced the \ character into ASCII, on September 18, 1961, as the result of character frequency studies. In particular the \ was introduced so that the ALGOL boolean operators (AND) and (OR) could be composed in ASCII as "/\" and "\/" respectively.[4] Both these operators were included in early versions of the C programming language supplied with Unix V6 , Unix V7 and more currently BSD 2.11.

In many programming languages such as C and Perl and in Unix scripting languages, the backslash is used to indicate that the character following it should be treated specially. It is sometimes referred to as a knock-down or escape character. In various regular expression languages it acts as a switch, changing literal characters into metacharacters and vice versa. The backslash is used similarly in the TeX typesetting system and in RTF files to begin markup tags. In Haskell, the backslash is used both to introduce special characters and to introduce lambda functions (since it is a reasonable approximation in ASCII of the Greek letter lambda, λ).

In the context of line-oriented text, especially source code for some programming languages, it is often used at the end of a line to indicate that the trailing newline character should be ignored, so that the following line is treated as if it were part of the current line. In this context it may be called a "continuation". The GNU make manual says[5]

We split each long line into two lines using backslash-newline; this is like using one long line, but is easier to read.

The underlying Windows API can accept either the backslash or slash to separate directory and file components of a path, but the Microsoft convention is to use a backslash, and APIs that return paths put backslash in.[6] MS-DOS 2.0 copied the hierarchical file system from Unix and thus used the forward slash, but (possibly on the insistence of IBM) added the backslash to allow paths to be typed into the command shell while retaining compatibility with MS-DOS 1.0 and CP/M where the slash was the command-line option indicator (i.e. as in typing "dir /w" to give the "wide" option to the "dir" command).[7]

Although the command shell was the only part of MS-DOS that required this, the use of backslash in filenames was propagated to most other parts of the user interface. Today, although the underlying operating system supports either character, some Windows programs and sub-systems do not accept the slash as a path delimiter or they may be misinterpreted. Some programs will accept them if the path is placed in double-quotes.[8] Some built-in security features have failed to recognize unexpected-direction slashes in local or internet paths, while other parts of the operating system still acted upon them; this has led to some serious lapses in security, where resources that should not be available have been accessed with paths using the correct mix, such as www.example.net/secure\private.aspx.[9][10]

In the Japanese ISO 646 encoding (a 7-bit code based on ASCII), the code point 0x5C that would be used for backslash in ASCII is instead rendered as a yen mark (¥), while in Korean encoding, it is drawn as a won currency symbol (₩). Computer programs still treat the code as a backslash in these environments, causing confusion.[11] Due to extensive use of the backslash code to represent the yen mark in text, some Unicode fonts like MS Mincho still render the backslash character as a ¥, so the Unicode characters 00A5 (¥) and 005C (\) look identical when these fonts are selected.

In mathematics, a backslash-like symbol is used for the set difference.

In some dialects of the BASIC programming language, the backslash is used as an operator symbol to indicate integer division.

In MATLAB, the backslash is used for left matrix divide, while the slash is for right matrix divide.

References

  1. ^ Mini-Biography of Bob Bemer
  2. ^ Macquarie Dictionary (3rd edition)
  3. ^ Raymond, Eric S. "ASCII".
  4. ^ Bob Bemer (2002-07-07). "The Great Curly Brace Trace Chase". Computer History Vignettes. Bob Bemer. Retrieved October 11, 2009.
  5. ^ GNU `make'
  6. ^ "Path.GetFullPath Method". .NET Framework Class Library. Microsoft Corporation. Retrieved 2009-01-02.
  7. ^ Why is the DOS path character "\"?
  8. ^ "When did Windows start accepting forward slash as a path separator?". Bytes.com. Retrieved 2009-01-02.
  9. ^ Kaplan, Simone (2004). "Microsoft Probes Flaw in ASP.NET". DevSource, sponsored by Microsoft. Ziff Davis Enterprise Holdings Inc. Retrieved 2009-06-14.
  10. ^ Burnett, Mark (2004). "Security Holes That Run Deep". SecurityFocus. Retrieved 2009-06-14.
  11. ^ When is a backslash not a backslash?