0

For example, 'foo bar' would be quoted as `foo bar', or ``foo bar''. Is it encouraged or general practice to use this quoting syntax? It seems to be quite common in some documentation.

3 Answers3

3

Please, no. WRT regular text: single quotes, fine. Double quotes, okay. Backticks are only used literally (eg, as they are with the shell) and not as quotes. There are also the extended charset characters “ (left double quote) and ” (right double quote), but since they are not on a normal keyboard, the " is usually used in place of both of them. There's also a right single quote and left single quote, but since they're not on the keyboard either the apostrophe ' usually stands in for them.

In the context of programming (including shell scripting), what quotes mean varies from language to language, none of which are specific to linux. Programming languages AFAIK restrict themselves to the ASCII character set, so the plain " and apostrophe ' for the single quote.

I have seen documentation here and there that does the kind of thing you are talking about. IMO it's ugly and ridiculous, but to each their own. It certainly does does not indicate anything beyond clumsiness, and even more certainly does not mean anything in a programming or shell context (other than "syntax error").

goldilocks
  • 87,661
  • 30
  • 204
  • 262
3

This is e.g. LaTeX usage to represent left and right double quotes (or left and right single quotes). Take a look at any well-printed book, and you'll see them used everywhere. The barbarous computer keyboards don't have these characters.

vonbrand
  • 18,253
1

This just depends on the convention in use. One widely used convention in README files is Markdown (just like here), and it uses `…` to literally quote.

I guess you referred to the program source comments context. If so, unfortunately, there is no well established standard in this area (although Markdown is a good candidate), thus the same for the way to quote a literal command or identifier.

Hibou57
  • 905