mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC1010 (markdown)
12
SC1010.md
12
SC1010.md
@@ -5,6 +5,11 @@
|
|||||||
```
|
```
|
||||||
for f in *; do echo "$f" done
|
for f in *; do echo "$f" done
|
||||||
```
|
```
|
||||||
|
or
|
||||||
|
|
||||||
|
```
|
||||||
|
echo $f is done
|
||||||
|
```
|
||||||
|
|
||||||
### Correct code:
|
### Correct code:
|
||||||
|
|
||||||
@@ -12,6 +17,13 @@ for f in *; do echo "$f" done
|
|||||||
for f in *; do echo "$f"; done
|
for f in *; do echo "$f"; done
|
||||||
```
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```
|
||||||
|
echo "$f is done"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Rationale:
|
### 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".
|
`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".
|
||||||
|
Reference in New Issue
Block a user