Skip to content
koalaman edited this page Jul 26, 2014 · 9 revisions

This \c will be a regular 'c' in this context.

Problematic code:

echo Yay \o/

or

\git status

Correct code:

echo 'Yay \o/'

or

command git status

Rationale:

Escaping something that doesn't need escaping sometimes indicates a bug.

If the backslash was supposed to be literal, single quote it.

If the purpose is to run an external command rather than an alias, prefer command.

Contraindications

If you have an alias and a function (as opposed to an external command), you can either ignore this message or use "name" instead of \name to quiet ShellCheck.

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally