Where to use?
This severe accent pattern and simple quotes is not unique to error messages. See an example in a section of the bash
:
Brace expansions may be nested. The Results of each Expanded
string are not Sorted; left to right order is preserved. For
example, a{d,c,b}e expands into `Ade ace Abe'.
Another slightly different example, with two accents and two single quotes, from the same manual:
-k file: True if file exists and its ``Sticky'' bit is set.
GNU-ism?
In the documentation of GNU, in the "Tooltips for Documentation Strings" section, there is a reference to this grave accent convention followed by simple quotes. It is called backtick-apostrophe Notation and is referred to as an old single quote convention.
In Emacs, when you `escreve'
thus, the text is highlighted, which facilitates the reading of manuals using this convention. The Emacswiki recommends this standard, but notes that the origins of the convention are uncertain.
In GNU mailing lists we see that other people have already questioned the origin, but the answer given by Barry Margolin was that perhaps the authors of the GNU documentation were, unfortunately, using a font in which the characters seemed balanced, that is, something visually similar to `palavra´
. However, the output to most sources was from what was actually written, `palavra'
, unbalanced.
Even with not so sure origin in the GNU environment, it can be said that the heritage of convention today is a GNU-ism.
Other possibilities
Another possible origin is the semantic and visual confusion of the characters with their possibilities in writing in stylized form:
`
: severe accent with ASCII code 96
"
: double quotes with ASCII code 34
'
: single quotes or quote with ASCII code 39
´
: acute accent with ASCII code 239
Nowadays, all four characters exist separately in ASCII. Before that, some 6-bit encodings had characters that served multiple semantic purposes. An example is '
which could be used as an accent, quotation marks and apostrophe.
From this analysis, it can be understood that GNU established this pattern as a legacy of ASCII times, in which most fonts printed the characters in question curved or hyper-stylized.
stdout formatting has more to do with Shell, which Shell is used in this example?
– ruansenadev
zsh
, but I don’t think it has anything to do with the shell. I tested onbash
and the exit was the same.– Luiz Felipe
Pq in stdout quotation marks places code, and code in
backticks\
can perform functions on multiple shells.. but would also like to know if this is msm kk– ruansenadev