7

I've just been looking through a few man pages for a few different commands including grep and ifconfig.

I've noticed over a few pages, the content uses a strange syntax to notate what i think are quotations (back-tick followed by a single or double quote):

`text'

Quote Example

Why can't they use ' or " to open and close quotations?

Update

I now realise that this should be bolding out the characters instead of noting quotes. Is there any reason my system is ignoring these when formatting? I'm using OSX.

10

Man pages historically have been written in the troff/nroff markup language, although there are alternatives now such as DocBook.

Troff, which is meant for preparing output to a phototypesetter (or to files in formats such as PostScript or PDF), will automatically change the ` and ' characters in the input into curved quotation marks, and . (See the Troff User’s Manual, section 2.1).

Nroff, which is what the man command runs when the output is to a terminal, will pass those characters through unchanged.

Those quotes are actually in the raw man page for the older version of GNU grep (2.5.1) in FreeBSD and OSX:

.B GREP_COLOR
environment variable. WHEN may be `never', `always', or `auto'

More recent versions of GNU grep do not have those quotes in the man page:

.I WHEN
is
.BR never ", " always ", or " auto .
| improve this answer | |
6

These quotation marks are often used because they look nice, similar to the quotation marks in printed books (which are different at the beginning and end of the quoted passage).

These quotation marks may also have been added by your local troff configuration (or, could be removed by it!). The actual file may not contain these characters literally. You can check with something like

zcat /usr/share/man/man8/ifconfig.8.gz | less

how the man pages look like on disk. They are formatted for screen output by the tron/troff family of programs (hardly known or in use today, but very useful in the text-only console times...). Check the man page of man(1) for details!

| improve this answer | |
  • As Mark Plotnik points out, the manual page in question does contain these characters in the source. Markus Kuhn has something to say on the subject of writers who went with (then) U.S. norms. – JdeBP May 21 '15 at 17:47
  • You are right. Regarding the link, thanks, but please consider that troff/nroff etc. were invented when characters were encoded as 7-bit ASCII - the comment of Mr Kuhn applies to Unicode times... – Ned64 May 21 '15 at 17:51
  • There are some viewers for man pages that re-format the page and add hyperlinks. One is built into KDE's konqueror web/file browser. Try the URI man:/usr/share/man/man1/ls.1.gz in its address bar. It also handles the newer (than man) info pages well: info:/bash/Top (again a URI for konqueror only). – Ned64 May 21 '15 at 18:04
  • 1
    @Ned64 or GNOME's Yelp (yelp man:ls, yelp info:grep#Introduction). – muru May 22 '15 at 0:29

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