From ca5cce37f3afc27f4daf2b96d6630c9768c121dd Mon Sep 17 00:00:00 2001 From: Don Richards Date: Tue, 6 Dec 2016 11:28:38 -0500 Subject: [PATCH] Initial Page Setup --- SC1020.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 SC1020.md diff --git a/SC1020.md b/SC1020.md new file mode 100644 index 0000000..e548d90 --- /dev/null +++ b/SC1020.md @@ -0,0 +1,26 @@ +## You need a space before the if single then "]" else "]]" + +### Problematic code: + +``` +if [ "$STUFF" = ""]; then +``` + +### Correct code: + +``` +if [ "$STUFF" = "" ]; then +``` + +### Rationale: +Bourne shells are very whitespace sensitive. Adding or removing spaces can drastically alter the meaning of a script. In these cases, ShellCheck has noticed that you're missing a space at the position indicated. + +### Exceptions +none. + +### Ignore +``` +# shellcheck disable=SC1020 +if [ "$STUFF" = ""]; then +... +``` \ No newline at end of file