标签:
case语句格式如下
#!/bin/bash read -p "please input code:" code case $code in "A") echo "beijing" ;; "B") echo "shanghai" ;; *) echo "unknown" ;; esac
"*"代表其他情况,注意每种情况后都需要加";;"
shell编程-多分支case语句
原文地址:http://www.cnblogs.com/jackgaolei/p/5142015.html