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.
;;Correct. ;; ends the selected case clause.
&&Incorrect. && is an AND-list operator.
doneIncorrect. 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
Shell function
A reusable group of commands that runs in the caller's shell context.
Positional parameter
A numbered argument or special value supplied to a script or function.
Control flow
Conditions, loops, and exit statuses determine which shell commands run.