End one POSIX sh case pattern clause.
Prevent execution from falling through to later patterns.
Which symbol belongs at the clause end?
Each POSIX case clause ends with ;;, and the entire case statement ends with esac.
Detailed explanation
;Incorrect. A single semicolon terminates a command, not the standard case clause.
Incorrect. A single semicolon terminates a command, not the standard case clause.
;;Correct. ;; ends the selected case clause.
Correct. ;; ends the selected case clause.
&&Incorrect. && is an AND-list operator.
Incorrect. && is an AND-list operator.
doneIncorrect. done closes a for or while loop.
Incorrect. done closes a for or while loop.
Try it yourself
An example you can run in a temporary verification environment.
sh -c 'v=b; case $v in a) echo A ;; b) echo B ;; esac'Expected result
BKey points
- ;; ends a clause
- esac ends the case statement
- done is for loops
Notes
- Environment: POSIX sh / 状態変更なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.