14

When bash is reporting a syntax error, it encapsulates the text which has raised the syntax error both with grave accent and with an apostrophe, like this: `...'. Any idea why?

Here's an example:

$ bash -c "echo error()"
bash: -c: line 0: syntax error near unexpected token `('
bash: -c: line 0: `echo error()'

This is not very common; however, I am just curious, this is not a real problem.

Edit: this gets weirder with obscure messages like this one:

-bash: unexpected EOF while looking for matching ``'
Braiam
  • 35,380
  • 25
  • 108
  • 167
Bach
  • 827
  • 1
  • 8
  • 11
  • 2
    May have common roots with [Where does backtick and single quote come from when denoting commands e.g. `prog'? [duplicate\]](http://unix.stackexchange.com/questions/87644/where-does-backtick-and-single-quote-come-from-when-denoting-commands-e-g-prog). – manatwork Mar 28 '14 at 10:58
  • 3
    The answer is here: "[Why do Unix man pages use double backticks in place of double quotes?](http://unix.stackexchange.com/questions/73989/why-do-unix-man-pages-use-double-backticks-in-place-of-double-quotes)" – Ouki Mar 28 '14 at 11:06

1 Answers1

7

In certain fonts, those quotation marks will appear as opposing pairs of curled single quotes. It's passé in today's Unicode world, but the code and practices that produced such quoting derive from a time before Unicode, or before its widespread availability.

Warren Young
  • 71,107
  • 16
  • 178
  • 168