case Command case Execute commands conditionally according to pattern case token in [ pattern [ | pattern ] ... ) sequence ;; ] ... esac case is a construct that used by the shell sh. It tells the shell to execute commands conditionally, according to a pattern. It tests the given token successively against each pattern, in the order given. It then executes the commands in the sequence corresponding to the first matching pattern. Optional `|' clauses specify additional patterns corresponding to a single se- quence. If no pattern matches the token, the case construct ex- ecutes no commands. Each pattern can include text characters (which match themsel- ves), special characters `?' (which matches any character except newline) and `*' (which matches any sequence of non-newline characters), and character classes enclosed in brackets `[ ]'; ranges of characters within a class may be separated by `-'. In particular, the last pattern in a case construct is often `*', which will match any token. The shell executes case directly. ***** See Also ***** commands, sh COHERENT Lexicon Page 1