#!/bin/bash
while true; do
read -p 'Prompt? (y/n) ' yn
case "$yn" in
y|Y)
echo 'YES!'
break;
;;
n|N)
echo 'NO!'
break;
;;
esac
done
This will loop until one of [yYnN]
is entered.