mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Fixed spelling mistake
32
SC1010.md
32
SC1010.md
@@ -1,17 +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:
|
||||
|
||||
`done` only works as a keyword when it's the first token of the command. If added after a command, it will just be the literal word "done".
|
||||
|
||||
### Contraindications
|
||||
|
||||
## 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:
|
||||
|
||||
`done` only works as a keyword when it's the first token of the command. If added after a command, it will just be the literal word "done".
|
||||
|
||||
### Contradictions
|
||||
|
||||
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 Task is done`, use `echo "Task is done"`.
|
Reference in New Issue
Block a user