From b65823abe51ad61557243b5b96b2f0c61816ff2a Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Thu, 16 Sep 2021 20:02:39 -0700 Subject: [PATCH] Add note about ignoring --- SC2016.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SC2016.md b/SC2016.md index be12abc..500967d 100644 --- a/SC2016.md +++ b/SC2016.md @@ -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) \ No newline at end of file