# # # function which gets a yes or a no, returns "y" or "n" # # function getyesno { noans=t prompt="$*" # while [ $noans = t ] ; do read intext?"${prompt} ( Must use y for yes, n for no )" if [ "x$intext" = xy ] ; then echo y noans=f elif [ "x$intext" = xn ] ; then echo n noans=f fi done } typeset -xf getyesno