- 使用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
时间: 2024-08-20 09:47:32