Add note about ignoring

Vidar Holen
2021-09-16 20:02:39 -07:00
parent d2918e3309
commit b65823abe5

@@ -42,6 +42,10 @@ ShellCheck also does not warn about escaped expansions in double quotes:
echo "PATH=\$PATH:/usr/local/bin" >> ~/.bashrc
```
This suggestion is primarily meant to help newbies who assume single and double quotes are basically the same, like in Python and JavaScript. It's not at all meant to discourage experienced users from using single quotes in general. If you are well aware of the difference, please do not hesitate to permanently disable this suggestion with `disable=SC2016` in your `.shellcheckrc`.
ShellCheck tries to increase the signal-to-noise ratio of this warning by ignoring certain well known commands that frequently expect literal dollar signs, such as `sh` and `perl`. However, there's a long tail of less common commands and flags that also frequently expect `$`s, and it's not in ShellCheck's scope to try to keep track of them all. When you come across such a command, please [[ignore]] the suggestion, either permanently or for that one instance.
### Related resources:
* StackOverflow: [How do I use variables in single quoted strings?](https://stackoverflow.com/questions/21192420/how-do-i-use-variables-in-single-quoted-strings)