mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC1085 (markdown)
22
SC1085.md
Normal file
22
SC1085.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
## Did you forget to move the ;; after extending this case item?
|
||||||
|
|
||||||
|
### Problematic code:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
case $options in
|
||||||
|
foobar) echo foo ;; echo bar;;
|
||||||
|
*) echo unknown option ;;
|
||||||
|
esac
|
||||||
|
```
|
||||||
|
|
||||||
|
### Correct code:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
case $options in
|
||||||
|
foobar) echo foo ; echo bar;;
|
||||||
|
*) echo unknown option ;;
|
||||||
|
esac
|
||||||
|
```
|
||||||
|
|
||||||
|
### Rationale:
|
||||||
|
There should be no statements between `;;` and the next case item.
|
Reference in New Issue
Block a user