linux shell编程中 case语句
001、
[root@PC1 test]# ls test.sh [root@PC1 test]# cat test.sh ## 测试脚本 #!/bin/bash read -p "please input an character:" key ## 给变量key赋值 case $key in ## case进行匹配 [0-9]) echo "number!" ;; [a-z]|[A-Z]) echo "letter!" ;; *) echo "other!" ;; esac