This is one way of doing it:
Code:
#!/bin/bash
VALID=no
while [[ $VALID = no ]]
do
echo -n "Do you want program X to run? (YyNn) : "
VALID=yes
read ANSWER
case $ANSWER in
Y|y ) echo "Answer is : $ANSWER" ;;
N|n ) echo "Answer is : $ANSWER" ;;
* ) echo "Invalid reply."
VALID=no ;;
esac
done
It includes an 'error' check, only Y, y, N and n are valid.
I'ts not finished, but I guess you can take it from here.
Hope this helps.