First page Back Continue Last page Graphics

Control: The CASE Statement (Quigley pages 900 – 902)

The variable is compared with the values using the shell wildcards ( ? * […] ) , NOT regular expressions. All the statements are executed for the first matching value until the ending ;;. If no value matches, then the default *) case is executed, if present.

case variable in

value1)

statements

;;

value2)

statements

;;

*)

statements

;;

esac