From b3968e640f3f0247160d22c52c1ad21fcb197dc2 Mon Sep 17 00:00:00 2001 From: koalaman Date: Thu, 10 Jul 2014 17:21:45 -0700 Subject: [PATCH] Created SC1010 (markdown) --- SC1010.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 SC1010.md diff --git a/SC1010.md b/SC1010.md new file mode 100644 index 0000000..62760cb --- /dev/null +++ b/SC1010.md @@ -0,0 +1,17 @@ +## Use semicolon or linefeed before 'done' (or quote to make it literal). + +### Problematic code: + + for f in *; do echo "$f" done + +### Correct code: + + for f in *; do echo "$f"; done + +### Rationale: + +(An explanation of why the code is problematic and how the correct code is an improvement) + +### Contraindications + +If you're intentionally using `done` as a literal, you can quote it to make this clear to shellcheck and human readers, e.g. instead of `echo I am done`, use `echo "I am done"`. \ No newline at end of file