case, switch, select — Shell Built-in Functions to Choose from a List of Actions
case word in [pattern [| pattern]) actions;;] ... esac
switch (expression) case comparison1: actions breaksw case comparison2: actions breaksw ... default: endsw
case word in [pattern [| pattern] ) actions;;] ... esac select identifier [in word...] ; do list; done
In shell scripts, you may want to take several different types of action depending on the value of a variable or a parameter. You can do so in the Bourne shell by using the case statement, in the C shell by using the case and switch statements, or in the Korn shell by using the case and select statements.
The value of the variable is successively compared against ...