条件语句练习
#!/bin/sbin cat <<END 1.panxiaoting 2.longzheluola 3.angelababy END read -p "Which do you like? Please input the num:" choice [ $choice == "1" ] &&{ echo "I guess, you like panxiaoting!" exit 0 } [ $choice == "2" ] &&{ echo "I guess, you like longzheluola!" exit 0 } [ $choice == "3" ] &&{ echo "I guess, you like angelababy!" exit 0 } [ $choice != "1" -o $choice != "2" -o $choice != "3" ] &&{ echo "I guess, you are not man!" }