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