mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC1001 (markdown)
29
SC1001.md
Normal file
29
SC1001.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
## 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.
|
Reference in New Issue
Block a user