Created SC1010 (markdown)

koalaman
2014-07-10 17:21:45 -07:00
parent 7514d0948c
commit b3968e640f

17
SC1010.md Normal file

@@ -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"`.