Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Backtick
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Typographical mark (`) (Freestanding grave accent)}} {{Use American English|date=January 2019}}{{Use dmy dates|date=May 2023}} {{Infobox symbol|mark=` |name=Backtick |unicode={{unichar|0060|grave accent}} (symbol) |see also={{unichar|0300|cwith=β|combining grave accent|nlink=Grave accent}} (diacritic) }} The '''backtick''' {{char|'''`'''}} is a typographical mark used mainly in [[computing]]. It is also known as '''backquote''', '''grave''', or '''[[grave accent]]'''. The character was designed for typewriters to add a grave accent to a (lower-case{{efn|Upper case letters would require the character to be printed higher on the page}}) base letter, by overtyping it atop that letter.<ref>{{Cite web |first=Markus |last=Kuhn |url=https://www.cl.cam.ac.uk/~mgk25/ucs/apostrophe.html |title=Apostrophe and acute accent confusion |quote=This key is on German typewriters a non-spacing key (DIN 2137). It does not advance the cursor, but causes the next character to appear below the accent |publisher=Department of Computer Science and Technology, University of Cambridge}}</ref> On early computer systems, however, this physical [[dead key]]+overtype function was rarely supported, being functionally replaced by [[precomposed character]]s.{{efn|In [[ISO/IEC 8859-1]] ("ISO Latin 1") and subsequently in [[Unicode]].}} Consequently, this ASCII symbol was rarely (if ever) used in computer systems for its original aim and became repurposed for many unrelated uses in computer programming. The sign is located on the left-top of a US or UK layout keyboard, next to the {{keypress|1}} key. Provision (if any) of the backtick on other keyboards varies by national [[keyboard layout]] and [[keyboard mapping]]. ==History== ===Typewriters=== [[File:Idazmakina.jpg |thumb|Spanish typewriter (QWERTY keyboard) with dead keys for acute, circumflex, diaeresis and grave accents.]] On typewriters designed for languages that routinely use [[diacritic]]s (accent marks), there are two possible solutions. Keys can be dedicated to pre-composed characters or alternatively a [[dead key]] mechanism can be provided. With the latter, a mark is made when a dead key is typed but, unlike normal keys, the paper carriage does not move on and thus, the next letter to be typed is printed under the accent. ===Incorporation into ISO 646 and ASCII=== {{further|ISO/IEC 646}} The incorporation of the grave symbol into ASCII is a consequence of this prior existence on typewriters. This symbol did not exist independently as a [[sort (typesetting)|type]] or [[Hot metal typesetting|hot-lead]] printing character. {{blockquote|It appears to have been at their May 13β15, 1963 meeting that the CCITT decided that the proposed ISO 7-bit code standard would be suitable for their needs if a lower case alphabet and five diacritical marks, including the grave accent, were added to it. At the October 29β31 meeting, then, the ISO subcommittee altered the ISO draft to meet the CCITT requirements, replacing the up-arrow and left-arrow with diacriticals, adding diacritical meanings to the apostrophe and quotation mark, and making the number sign a dual for the tilde.<ref>{{cite web|url=https://jkorpela.fi/latin1/ascii-hist.html#60|title=Character histories: notes on some ASCII code positions}}</ref> |source=Yucca's free information site}} Thus, ISO{{nbsp}}646 was born and the ASCII standard updated to include the backtick and other symbols.{{efn|ISO{{nbsp}}646 (and ASCII, which it includes) is a standard for 7-bit encoding, providing just 96 printable characters (and 32 [[control characters]]). This was insufficient to meet the needs of Western European languages and so the standard specifies certain [[code points]] that are available for national variation. The code point allocated to backtick is 0x60 (decimal 96) is one such. Consequently, code-point 0x60 was often reallocated in local character sets to a more useful character. For example, in the French ISO{{nbsp}}646 standard, the character at this position is ''[[Micro-|ΞΌ]]''. Many older UK computers (such as the [[ZX Spectrum]] and [[BBC Micro]]) have the [[pound sign]] (Β£) symbol at character 0x60, although [[Code page 1013|BS 4730]] (the British ISO{{nbsp}}646 variant) placed 'Β£' at position 0x23 instead. With the arrival of 8-bit "[[extended ASCII]]", this issue was largely mitigated, though not fully resolved until [[Unicode]] was established.}} ===As surrogate of apostrophe or (opening) single quote=== Some early ASCII peripherals designed the backtick and apostrophe to be mirror images of each other: {{char|‛}} and {{char|’}}.<ref>{{Cite web |first=Markus |last=Kuhn |url=http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html |title=ASCII and Unicode quotation marks |quote=Please do not use the ASCII grave accent as a left quotation mark |publisher=Department of Computer Science and Technology, University of Cambridge}}</ref> This allowed them to be used as matching pairs of open and close quotes while still being somewhat usable as grave and acute accents, made apostrophes typographically correct, and allowed the apostrophe to be used as a prime. This had a number of problems that led most modern systems and Unicode to render the apostrophe as a "straight" one: * Open quote is not typographically correct: the correct form ({{char|‘}}) is flipped vertically from what is shown here. * No matching double quotes, although two single quotes looked acceptable on proportionally-spaced devices. * Wrong appearance if used as overprinted diacritics. * Lots of software and documents used the apostrophe for opening as well as for closing quotes. This can still be seen in documents and email from that time (before 1990), and in output generated by some UNIX console programs such as [[man pages]]. Institutions that traditionally had used it have abandoned or deprecated it.<ref>{{Cite web |quote=<nowiki>In the C locale, the output of GNU programs should stick to plain ASCII for quotation characters in messages to users: preferably 0x22 (β"β) or 0x27 (β'β) for both opening and closing quotes. Although GNU programs traditionally used 0x60 (β`β) for opening and 0x27 (β'β) for closing quotes, nowadays quotes β`like this'β are typically rendered asymmetrically, so quoting β"like this"β or β'like this'β typically looks better.</nowiki> |url=https://www.gnu.org/prep/standards/html_node/Quote-Characters.html#Quote-Characters |title=GNU Coding Standards: Quote Characters |work=GNU Coding Standards |publisher=[[Free Software Foundation]] |date=19 February 2019 |access-date=12 March 2019}}</ref><ref>{{cite web |url=https://lists.gnu.org/archive/html/bug-texinfo/2012-01/msg00026.html |title=<nowiki>makeinfo should quote 'like this' instead of `like this'</nowiki> |first=Paul |last=Eggert |date=23 January 2012 |work=bug-texinfo Archives |access-date=27 March 2018}}</ref> == Computing == === Command-line interface languages === Many [[List of programming languages by type#Command-line interface languages|command-line interface languages]] and the [[scripting languages|scripting (programming) languages]] like [[Perl]], [[PHP]], [[Ruby (programming language)|Ruby]] and [[Julia (programming language)|Julia]] (though see below) use pairs of backticks to indicate [[command substitution]]. A command substitution is the [[standard output]] from one command, into an embedded line of text within another command.<ref>{{cite web|url=https://mywiki.wooledge.org/CommandSubstitution|title=Command Substitution|website=wooledge.org|access-date=2024-08-06}}</ref><ref>{{cite web|url=http://zsh.sourceforge.net/Intro/intro_7.html|title=An Introduction to the Z Shell β Command/Process Substitution|website=zsh.sourceforge.net|access-date=27 March 2018}}</ref> For example, using $ as the symbol representing a terminal prompt, the code line: : {{sxhl|2=console|$ echo "It is now `date`" It is now {{#time:D M j H:i:s e Y}}}} In all POSIX [[Shell (computing)|shell]]s (including [[Bash (Unix shell)|Bash]] and [[Z shell|Zsh]]), the use of backticks for command substitution is now largely deprecated in favor of the notation <code>$(...)</code>, so that the example above would be re-written: : {{sxhl|2=console|$ echo "It is now $(date)"}} The new syntax allows nesting, for example: : {{sxhl|2=console|$ echo "An absolute path to the 'zcat' command is $( readlink -e "$( type -P zcat )" )" An absolute path to the 'zcat' command is /usr/bin/gzip}} === Markup languages === It is sometimes used in [[source code comments]] to indicate code, e.g., : <pre>/* Use the `printf()` function. */</pre> This is also the format the [[Markdown]] formatter uses to indicate code.<ref>{{Cite web|url=http://daringfireball.net/projects/markdown/syntax#code|title = Daring Fireball: Markdown Syntax Documentation}}</ref> Some variations of Markdown support "fenced code blocks" that span multiple lines of code, starting (and ending) with three backticks in a row (<code>```</code>).<ref>{{cite web |url=https://github.github.com/gfm/#fenced-code-blocks |title=GitHub Flavored Markdown Spec |access-date=23 February 2022 |archive-url=https://web.archive.org/web/20220221045705/https://github.github.com/gfm/#fenced-code-blocks |archive-date=21 February 2022 |url-status=live}}</ref> * [[TeX]]: The backtick character represents curly opening quotes. For example, <code>`</code> is rendered as single opening curly quote ({{not a typo|β}}) and <code>``</code> is a double curly opening quote ({{not a typo|β}}). It also supplies the numeric ASCII value of an ASCII character wherever a number is expected. === Programming languages === * [[BBC BASIC]]: The backtick character is valid at the beginning of or within a variable, structure, procedure or function name. * [[D (programming language)|D]] and [[Go (programming language)|Go]]: The backtick surrounds a [[String literal#Raw strings|raw string literal]]. * [[F Sharp (programming language)|F#]]: Surrounding an identifier with double backticks allows the use of identifiers that would not otherwise be allowed, such as keywords, or identifiers containing punctuation or spaces. * [[Haskell (programming language)|Haskell]]: Surrounding a function name by backticks makes it an [[infix notation|infix operator]]. * [[JavaScript]]: [[ECMAScript 6]] standard introduced a "backtick"<ref>{{Cite web|url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals|title=Template literals (Template strings)|website=MDN Web Docs|language=en|access-date=2019-05-22}}</ref> character which indicated a string or [[String interpolation|template literal]]. Its applications include (but are not limited to): string interpolation (substitution), embedded expressions, and multi-line strings. In the following example <code>name</code> and <code>pet</code> variable's values get substituted into the string enclosed by grave accent characters: ::<syntaxhighlight lang="js"> const name = "Mary", pet = "lamb"; // Set variables let temp = `${name} has a little ${pet}!`; console.log(temp); // => "Mary has a little lamb!"; </syntaxhighlight> * [[Lisp (programming language)|Lisp]] [[macro (computer science)|macro]] systems: The backtick character (called ''quasiquote'' in [[Scheme (programming language)|Scheme]]) introduces a quoted expression in which comma-substitution may occur. It is identical to the plain quote, except that a nested expression prefixed with a [[comma (punctuation)|comma]] is replaced with the value of that nested expression. If the nested expression happens to be a symbol (that is, a variable name in Lisp), the symbols' value is used. If the expression happens to be program code, the first value returned by that code is inserted at the respective location instead of the comma-prefixed code. This is roughly analogous to the Bourne shell's [[variable interpolation]] with <CODE>$</CODE> inside double quotes. * [[Julia (programming language)|Julia]]: Backticks make a command object, <code>Cmd</code>, that can be run, with run function, like <code>run(`echo Hello world!`)</code>. You can interpolate Julia variables, but only indirectly shell environment variables. * [[m4 (computer language)|m4]]: A backtick together with an apostrophe quotes strings (to suppress or defer macro expansion). * [[MySQL]]/[[MariaDB]]: A backtick in queries is a delimiter for column, table, and database identifiers. * [[OCaml]]: The backtick indicates polymorphic variants. * [[Pico programming language|Pico]]: The backtick indicates comments in the programming language. * [[PowerShell]]: The backtick is used as the escape character. For example, a newline character is denoted <code>`n</code>. Most common programming languages use a backslash as the escape character (e.g., <code>\n</code>), but because Windows allows the backslash as a path separator, it is impractical for PowerShell to use backslash for a different purpose. Two backticks produce the <code>`</code> character itself. For example, the [[Nullable type|nullable]] [[Boolean data type|boolean]] of [[.NET Framework|.NET]] is specified in PowerShell as <code>[Nullable``1[System.Boolean]]</code>. * [[Python (programming language)|Python]]: Prior to version 3.0, backticks were a synonym for the <code>repr()</code> function, which converts its argument to a string suitable for a programmer to view. However, this feature was removed in Python 3.0. Backticks also appear extensively in the [[reStructuredText]] plain text markup language (implemented in the Python [[docutils]] package). * [[R (programming language)|R]]: The backtick is used to surround non-syntactic variable names. This includes variable names containing special characters or [[reserved words]], among others.<ref name="R Documentation">{{Citation |author=R Core Team |title=Quotes: Quotes |publisher=R Foundation for Statistical Computing |url=https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/Quotes|postscript=.}}</ref> * [[Racket (programming language)|Racket]]: The backtick or "Quasiquote" is used to begin creating lists. * [[Scala (programming language)|Scala]]: An identifier may also be formed by an arbitrary string between backticks. The identifier then is composed of all characters excluding the backticks themselves.<ref>{{Citation| last = Odersky| first = Martin| title = The Scala Language Specification Version 2.9| date = 2011-05-24}}</ref> * [[Tom (pattern matching language)|Tom]]: The backtick creates a new term or to calls an existing term. * [[Unlambda]]: The backtick character denotes function application. * [[Verilog]] [[hardware description language|HDL]]: The backtick is used at the beginning of compiler's directives. == Games == In many PC-based computer games in the US and UK, the {{key press|`}} key is used to open the [[Console (video game CLI)|console]] so the user can execute script commands via its [[command line interface|CLI]]. {{citation needed|date=February 2016}} This is true for games such as ''[[Factorio]]'', ''[[Battlefield 3]]'', ''[[Half-Life (video game)|Half-Life]]'', ''[[Halo: Combat Evolved|Halo CE]]'', ''[[Quake (video game)|Quake]]'', ''[[Half-Life 2]]'', ''[[Blockland (video game)|Blockland]]'', ''[[Soldier of Fortune II: Double Helix]]'', ''[[Unreal (1998 video game)|Unreal]]'', ''[[Counter-Strike]]'', ''[[Crysis]]'', ''[[The Elder Scrolls III: Morrowind|Morrowind]]'', ''[[The Elder Scrolls IV: Oblivion|Oblivion]]'', ''[[The Elder Scrolls V: Skyrim|Skyrim]]'',<ref>{{Cite web |url=https://en.uesp.net/wiki/Skyrim:Console_Commands#General_Information |title=Skyrim:Console |website=UESPWiki |access-date=15 November 2019}}</ref> ''[[Fallout: New Vegas]]'', ''[[Fallout 3]]'', ''[[Fallout 4]]'', ''[[RuneScape]]'', and games based on the [[Quake engine]] or [[Source (game engine)|Source engine]]. {{citation needed|date=February 2016}} While not necessarily the original progenitor of the console key concept, ''Quake'' is still widely associated with any usage of the {{key press|`}} key as a toggle for a drop-down console, often being referred to as the "Quake Key". In 2021, [[Windows Terminal]] introduced a "Quake Mode" which enables a global shortcut of {{key_press|Win}}+{{key press|`}} that opens a terminal window pinned to the top half of the screen.<ref>{{cite web |last1=Cinnamon |first1=Kayla |title=Windows Terminal Preview 1.9 Release |url=https://devblogs.microsoft.com/commandline/windows-terminal-preview-1-9-release/ |website=devblogs.microsoft.com |access-date=5 June 2023}}</ref> == See also == * [[Tilde]] ==Notes== {{notelist}} ==References== {{Reflist}} {{DEFAULTSORT:Backtickfb}} [[Category:Typographical symbols]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Blockquote
(
edit
)
Template:Char
(
edit
)
Template:Citation
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite web
(
edit
)
Template:Efn
(
edit
)
Template:Further
(
edit
)
Template:Infobox symbol
(
edit
)
Template:Key press
(
edit
)
Template:Keypress
(
edit
)
Template:Nbsp
(
edit
)
Template:Not a typo
(
edit
)
Template:Notelist
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Sxhl
(
edit
)
Template:Use American English
(
edit
)
Template:Use dmy dates
(
edit
)