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
标签:case,shell,##,echo,key,linux,test From: https://www.cnblogs.com/liujiaxin2018/p/17153473.html