The easiest way to achieve this with the least number of lines is as follows:
read -p "<Your Friendly Message here> : y/n/cancel" CONDITION; if [ "$CONDITION" == "y" ]; then # do something #doSomethinghere! fi The "if"if is just an example,: it is up to you how to handle this variable.