周哥教IT之Windbg調(diào)試精講
#!/bin/bash
read -p "Do you agree? Yes or No: " INPUT
INPUT=`echo $INPUT | tr 'A-Z' 'a-z'`
case $INPUT in
y|yes)
? ?echo "You have agreed!"
? ?;;
n|no)
? ?echo "You have disagreed!"
? ?;;
*) ?
? ?echo "Wrong answer!!!"
esac
Yes or No方法2
#!/bin/bash
read -p "Do you agree?: " INPUT
case $INPUT in
[Yy] | [Yn][Ee][Ss])
? ?echo "You have agreed!!!"
? ?;;
[Nn] | [Nn][Oo])
? ?echo "You have disagreed!!"
? ?;;
*)
? ?echo "Wrong answer!!!"
esac ?
標(biāo)簽: