From 02ffc404ec419152fe1df022e8ff3cd3264b4e7c Mon Sep 17 00:00:00 2001 From: koalaman Date: Mon, 8 Aug 2016 14:28:06 -0700 Subject: [PATCH] Created SC1054 (markdown) --- SC1054.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 SC1054.md diff --git a/SC1054.md b/SC1054.md new file mode 100644 index 0000000..9065236 --- /dev/null +++ b/SC1054.md @@ -0,0 +1,22 @@ +## You need a space after the '{'. + +### Problematic code: + +```sh +foo() {echo "hello world;} +``` + +### Correct code: + +```sh +foo() { echo "hello world;} +``` +### Rationale: + +`{` is only recognized as the start of a command group when it's a separate token. + +If it's not a separate token, like in the problematic example, it will be considered a literal character, as if writing `"{echo"` with quotes, and therefore usually cause a syntax error. + +### Exceptions: + +None. \ No newline at end of file