3

The back-tick "result-of-quote" character ` used in *nix scripts doesn't appear to render properly in posts.

a=` cat file.txt`

Mmh it is working here but it definitely not working on the following post :

Pi not reading file using Bash script on startup

2 Answers 2

5

Backticks are used for the Markdown syntax for inline code. Thus, if you write:

Use `cat ` instead of `<`

it renders as:

Use cat instead of <

With "cat" and "<" in a monospace font (and with a gray background, but you can't see that inside a blockquote, since those have the exact same gray background color).


To get a literal backtick in normal text, you can simply escape it with a backslash, like this: "\`" → "`".

Getting a literal backtick into an inline code span is a bit tricky, but there's a (somewhat poorly documented) way to do it, by using multiple backticks as alternative code delimiters. That is, if you want to write:

Use `cat ` instead of `<`

you can do so by typing:

 Use `` `cat ` `` instead of `` `<` ``

Another way to achieve the same result is to use HTML <code> tags, like this:

 Use <code>\`cat \`</code> instead of <code>\`<\`</code>

or like this:

 Use <code>&#96;cat &#96;</code> instead of <code>&#96;<&#96;</code>

(where &#96; is the HTML character entity for a backtick). Both of these render the same way as the previous example above.

Ps. The (multi)backtick syntax also works in comments, but <code> tags (or HTML tags in general) don't.

3

It renders correctly if you put the code on a separate line and the wrap it as Preformatted Text (code). Like this:

`cat `

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .