使用case..in..esac做判断
#!/bin/bash read -p "Please make a choice:" choice case $choice in "one") echo "Your choice is one";; "two") echo "Your choice is two";; "three") echo "Your choice is three";; *) echo "Usage $0{one|two|three}";; esac
原文地址:http://roubin.blog.51cto.com/6940094/1631920