15

We know that the backtick character is used for command substitution:

chown `id -u` /mydir

Which made me wonder: is the tick character ´ used for anything in the Linux shell?


Note: incidentally, command substitution can also be written more readably as
chown $(id -u) /mydir

5
  • 3
    I was unsure of the name, but I thought ´ is called acute accent only when used as a diacritic (and, conversely, ` is called grave accent). When used alone, as the latter is a backtick, it seemed natural for the former to be called a tick or forward tick (please let's not call it reverse backtick). I've modified the title question to include your note.
    – dr_
    Nov 2, 2018 at 10:20
  • 1
    fair enough. I've removed the comment. Nov 2, 2018 at 10:26
  • 1
    @dr01 It might be worth putting in the title something like "(not `)" to help with confusion. Nov 2, 2018 at 14:02
  • A similar-looking character, the apostrophe (', ASCII 39, U+0027) has meaning in many of the Unix shells (e.g. the Bourne shell /bin/sh) and Linux shells (e.g. /bin/bash). It prevents words splitting and all expansions. So ls '$foo [bar]' returns an error unless there is a file named $foo [bar] in the current directory. It's equvalent to ls "\$foo [bar]" and ls \$foo\ \[bar\].
    – pts
    Nov 2, 2018 at 14:24
  • 1
    There are many similar-looking characters in Unicode, see cl.cam.ac.uk/~mgk25/ucs/quotes.html for an incomplete list, and see en.wikipedia.org/wiki/Prime_(symbol) for some more symbols. Out of all these, only the ASCII characters (', ", `) have special meaning in Unix shells.
    – pts
    Nov 2, 2018 at 14:33

2 Answers 2

30

The character sets used historically with Unix, including ASCII, don’t have a tick character, so it wasn’t used. As far as I’m aware no common usage for that character has been introduced since it’s become available; nor would it, since it’s not included in POSIX’s portable character set.

` was apparently originally included in ASCII (along with ^ and ~) to serve as a diacritic. When ASCII was defined, the apostrophe was typically represented by a ′-style glyph (“prime”, as used for minutes or feet) rather than a straight apostrophe ', and was used as a diacritic acute accent too.

Historically, in Unix shell documentation, ` was referred to as a grave accent, not a backtick. The lack of a forward tick wouldn’t have raised eyebrows, especially since ' was used as the complementary character (see roff syntax).

4
  • 6
    "Presumably ´ wasn’t considered common enough to make the cut (despite its widespread use in non-American languages)." Touché.
    – dr_
    Nov 2, 2018 at 10:03
  • 6
    Characters outside the POSIX portable character set (a subset of ASCII) would not be used in the syntax of shells, as their encoding would typically vary between locales (and may not be found in some including the C locale). For instance, on a GNU system, ´ is 0xB4 in a fr_FR.iso88591 locale, 0xC2 0xB4 in a fr_FR.UTF-8 and doesn't exist in the C locale. Nov 2, 2018 at 10:10
  • @StéphaneChazelas What you say remains true even if fr_FR is replaced with any other language. The encoding of the character is a property of the encoding (ISO-8859-1 or UTF-8).
    – kasperd
    Nov 2, 2018 at 17:00
  • 2
    @kasperd, yes, I did not mean to imply that the language made a difference. The choice of fr_FR was arbitrary, it just happens I have such locales on my system. Of course it would be the same with en_GB.UTF-8... Nov 2, 2018 at 17:05
13

Although the ASCII committee thought of ` as a diacritic and ' as an apostrophe, the Unix tradition was to treat them as left and right single quotes (the characters that are now in Unicode as U+2018 and U+2019). This is most obvious from the TeX convention that you write ``quoted text'' in the markup source and you get “quoted text” in the formatted document. This can also be seen in older monospace fonts, such as the bitmap fonts shipped with X11R5 and X11R6, where the two characters were given mirror-image glyphs.

As such, ` and ' were considered each others' inverse, and ´ was not felt to be missing.

8
  • 3
    Ah yes, I remember that LaTeX syntax!
    – dr_
    Nov 2, 2018 at 14:47
  • 1
    @dr01: Which suddenly makes sense when you discover some of the old fonts have them as mirrors of each other.
    – Joshua
    Nov 2, 2018 at 16:06
  • 3
    ' was explicitly defined in ASCII as APOSTROPHE, RIGHT SINGLE QUOTATION MARK, ACUTE_ACCENT by ANSI, it's not only a Unix thing. There is no other right single quotation mark in ASCII. Nov 2, 2018 at 16:35
  • 2
    @Joshua: The changing of said fonts was a matter of major controversy/backlash when it happened (probably late 90s or shortly after 2000). It was not just xterm fonts, but all of the standard X11 bitmap fonts, including the bitmap Times/Helvetica/etc. used in browsers and other applications with proportional-spaced fonts. Nov 2, 2018 at 17:09
  • 1
    Not enough backlash to stop it unfortunately! Unicode advocates running around telling everybody the ASCII apostrophe is a vertical line, in direct contradiction to the example glyph in the actual ASCII standard... and now almost every font has that stupid thing in position 0x27 instead of a decent-looking apostrophe
    – user41515
    Nov 2, 2018 at 19:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .