case string in
exp1)
若干个命令行
;;
exp2)
若干个命令行
;;
...
*) #用通配符*来处理无匹配项情况
esac
#!/bin/bash
echo "Enter A,B,C"
read letter
case $letter in
A|a)
echo "you entered A."
;;
B|b)
echo "you entered B."
;;
C|c)
echo "you entered C."
;;
*)
echo "not A,B,C."
esac
- End -