and match against patern.
case word in [ [(] pattern [ | pattern ] ... ) list ;; ] ... esac
case command first expands word,
and tries to match it against each pattern in
turn, using the same matching rules as for pathname expansion (see Pathname
The word is
expanded using tilde expansion, parameter and variable expansion, arithmetic
substitution, command substitution, process substitution and quote removal.
Each pattern examined
is expanded using tilde expansion, parameter and variable expansion, arithmetic
substitution, command substitution, and process substitution. If the shell
option nocasematch is enabled, the match is performed without regard to the case
of alphabetic characters.
a match is found, the corresponding list is
executed. After the first match, no subsequent matches are attempted.
exit status is zero if no pattern matches. Otherwise, it is the exit status of
the last command executed in list.
is a bash builtin command