-2

I was reading through the original bourne shell signal handling implementation and noticed an expression inside a comment was quoted this way:

/* `stakbot' is preserved by this routine */
   ^^^^^^^^

also the zsh user guide

The command `bye' is identical to `exit'

and IIRC the zsh man pages use this same notation.
Why?

Is it to prevent the code from being accidentally being interpreted as a backtick expression and executed ?
or is it simply a convention?

1 Answers1

2

That's just using the backtick as an opening quote; it's the equivalent of

‘stakbot’ is preserved by this routine

and

The command ‘bye’ is identical to ‘exit’

using only ASCII characters.

Stephen Kitt
  • 434,908
  • thanks, so it is simply a convention of quoting when writing documentation and comments? i.e. there is no significance to a parser or from a syntax point of view? – the_velour_fog Sep 21 '16 at 08:20
  • 1
    In the contexts you've given (a comment in C code, and HTML documentation), there is no significance for a parser. (Even in other contexts, there isn't much significance, at least within comments or documentation; ` and ' are explicitly defined as opening and closing quotes in TeX, I'm not sure about nroff.) – Stephen Kitt Sep 21 '16 at 08:34
  • thanks, at first I didn't notice you had used different opening and closing quotes in this line: ‘stakbot’. So essentially when you don't have access to those characters - and you want to use a quote which is specifically for opening and another for closing - \....'` is a kind of DIY way of achieving that. cool, thanks. – the_velour_fog Sep 21 '16 at 09:17