Why some messages are enclosed in backtick and single inverted comma?

I observed many times that some messages in Terminal or some part of them is enclosed in backtick and single inverted comma. For example, the output of type -a ls generate

ls is aliased to `ls --color=auto'

I expect backticks and inverted commas to work in pairs but here, there is 1 backtick in the beginning and 1 single inverted comma in the end.

Why there is no closing backtick or starting inverted comma? Is it a standard?

Answer

The pair of enclosing backtick and single quote characters is not a bash programming language syntax standard, it’s a terminal message typographical thing.

Enclosing a snippet of a terminal message in a backtick and single quote violates the normal rule of enclosing text in either a pair of single quotes or a pair of double quotes in order to suggest that the enclosed text is identified as being separate from the other text that surrounds it without also suggesting that the single quotes or double quotes that might otherwise enclose it were a necessary part of the text snippet being identified as separate from the rest of the terminal message that surrounds it. That suggests that the pair of backtick and single quote characters that enclose a text snippet are not part of a command that could be typed somewhere else.

In the example ls is aliased to `ls --color=auto' the string `ls --color=auto' is intended to be interpreted logically by the reader as ls --color=auto if it was typed somewhere else as part of a command, and the pair of backtick and single quote characters in `ls --color=auto' serve no other purpose than identifying that string to the reader as being logically separate from the rest of the terminal message that surrounds it.

Attribution
Source : Link , Question Author : Kulfy , Answer Author : karel

Leave a Comment