13

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 ``'
8

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.

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.