The user input is determined YES or NO

! # bin / bash
# Author: liusingbon
# Function: judgment entered by the user is Yes or NO
the Read -p "Are you the Sure [the y-/ the n-]:?" the Sure
Case $ the Sure in
the y-| the Y-| Yes | yes | YES)
       echo "$ you the Enter the Sure" ;;
the n-| N | NO | NO)
       echo "$ you the Enter the Sure" ;;
*)
       echo "error" ;;
esac

Guess you like

Origin www.cnblogs.com/liusingbon/p/11199673.html