The syntax of the case command is:
case word in
[(] pattern1 ) compound-list ;;
[[(] pattern[ | pattern] ... ) compound-list ;;] ...
[[(] pattern[ | pattern] ... ) compound-list]
esac
Syntax for case also can be printed in bash by the command below (it is suitable for POSIX shell as well):
$ help case
case: case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac Execute commands based on pattern matching. Selectively execute COMMANDS based upon WORD matching PATTERN. The `|' is used to separate multiple patterns. Exit Status: Returns the status of the last command executed.
Syntax in man bash:
case word in [ [(] pattern [ | pattern ] ... ) list ;; ] ... esac
can be found by ^ *case pattern.
Example of usage:
time="1m"
case "$time" in
*h*|*m*|*s*)
echo "first case"
echo "handling several cases for h, m, s tokens" ;;
*)
echo "seconds case"
echo "handling other cases" ;;
esac
References and related questions with examples: