mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Fix caps and highlight examples
10
SC1010.md
10
SC1010.md
@@ -4,24 +4,24 @@
|
|||||||
|
|
||||||
### Problematic code:
|
### Problematic code:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
for f in *; do echo "$f" done
|
for f in *; do echo "$f" done
|
||||||
```
|
```
|
||||||
or
|
or
|
||||||
|
|
||||||
```
|
```sh
|
||||||
echo $f is done
|
echo $f is done
|
||||||
```
|
```
|
||||||
|
|
||||||
### Correct code:
|
### Correct code:
|
||||||
|
|
||||||
```
|
```sh
|
||||||
for f in *; do echo "$f"; done
|
for f in *; do echo "$f"; done
|
||||||
```
|
```
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|
||||||
```
|
```sh
|
||||||
echo "$f is done"
|
echo "$f is done"
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -34,4 +34,4 @@ In the example, `echo "$f" done` is the same as `echo "$f" "done"`, and the `don
|
|||||||
|
|
||||||
### Exceptions
|
### Exceptions
|
||||||
|
|
||||||
If you're intentionally using `done` as a literal, you can quote it to make this clear to shellcheck (and also human readers), e.g. instead of `echo Task is done`, use `echo "Task is done"`. This makes no difference to the shell, but it will silence this warning.
|
If you're intentionally using `done` as a literal, you can quote it to make this clear to ShellCheck (and also human readers), e.g. instead of `echo Task is done`, use `echo "Task is done"`. This makes no difference to the shell, but it will silence this warning.
|
||||||
|
Reference in New Issue
Block a user