mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC1058 (markdown)
27
SC1058.md
Normal file
27
SC1058.md
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
## Expected `do`.
|
||||||
|
|
||||||
|
### Problematic code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
for file in *
|
||||||
|
echo "$file"
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
### Correct code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
for file in *
|
||||||
|
do
|
||||||
|
echo "$file"
|
||||||
|
done
|
||||||
|
```
|
||||||
|
### Rationale:
|
||||||
|
|
||||||
|
ShellCheck has found a loop that appears to be missing a `do` statement. In the problematic code, it was simply forgotten.
|
||||||
|
|
||||||
|
Verify that the `do` exists, and that it's in the correct place.
|
||||||
|
|
||||||
|
### Exceptions:
|
||||||
|
|
||||||
|
None
|
Reference in New Issue
Block a user