I've noticed that man pages and other documents formatted by Unix utilities often use double backticks `` followed by double single quotes '' to wrap quoted phrases instead of the double quote character ". Single quotes are similarly replaced. Why is this?

Here are a couple examples, from the man page for grep:

 To find all occurrences of the pattern `.Pp' at the beginning of a line:

       $ grep '^\.Pp' myfile

 The apostrophes ensure the entire expression is evaluated by grep instead
 of by the user's shell.  The caret `^' matches the null string at the
 beginning of a line, and the `\' escapes the `.', which would otherwise match
 any character.

 The grep utility is compliant with the IEEE Std 1003.1-2008 (``POSIX.1'')
  • I don't have enough for a full answer, but Emacs (in just about all the modes I've seen) has special highlighting for `...', making it stand out (even within comments). – echristopherson Jul 11 '16 at 19:50

The semantics and the usual glyphs for these characters have changed (several times) during the last 50 years.

The six-bit predecessors of ASCII contained various multi-purpose characters, including one single quote-like character, which was used for anything that had some similarity with a quote: opening quote, closing quote, apostrophe, or (by overprinting) acute or grave accent.

ASCII introduced one more quote-like character, so that now we had ', which was used as apostrophe, closing quote, and acute accent, and `, which was used as opening quote or grave accent (the concrete glyphs differed in various fonts).

For some bizarre reason, ISO-8859-1 declared ' to be an apostrophe or undirected quote, declared ` to be a grave accent, added one more accent ´ (acute accent), and abolished overprinting (so that the isolated accent marks were now completely pointless). Later extensions (MS-Windows codepages and Unicode) fixed this by introducing new directed quote characters and combining accents.

What you see here is essentially a relict from ASCII times, when most fonts had paired (slanted and/or curly) glyphs for ' and `.

  • 4
    Actually, ISO-8859-1 was irrelevant to overprinting and reflects an effect rather than a cause. That was lost due to (essentially) no video terminal support for the feature. Hardcopy terminals are unaffected. – Thomas Dickey Mar 13 '16 at 12:40

Output like that is generated by makeinfo from Texinfo sources. Texinfo can also render to other formats like PDF, so it needs to be more expressive than ASCII. Maybe to avoid throwing away semantics, makeinfo encodes quotes like that, so you can see what is opening and closing quotes.

Example: If you couldn't see the difference, I can imagine I'd be a bit confusing if you wrote some Texinfo source and relied on the quote difference being visible, because you would have previewed it as PDF. Because you never rendered with makeinfo, you'd never discover that it isn't readable, rendered like that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.