mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Created SC1074 (markdown)
30
SC1074.md
Normal file
30
SC1074.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# Did you forget the `;;` after the previous case item?
|
||||||
|
|
||||||
|
### Problematic code:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
while getoptions f option
|
||||||
|
do
|
||||||
|
case "${options}"
|
||||||
|
in
|
||||||
|
f) FTR="${ARG}"
|
||||||
|
\?) exit
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
### Correct code:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
while getoptions f option
|
||||||
|
do
|
||||||
|
case "${options}"
|
||||||
|
in
|
||||||
|
f) FTR="${ARG}"
|
||||||
|
\?) exit;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
```
|
||||||
|
|
||||||
|
### Rationale:
|
||||||
|
Syntax `case` needs `;;` after the previous case item. If not, syntax error will cause.
|
Reference in New Issue
Block a user