continue_promptYN()
{
_STR=$1
_DEFAULT=$2
if [ $# -lt 1 ]; then
echo "continue_prompt:I need a string to display"
return 1
fi
while :
do
echo -n "$_STR [Y...N] [$_DEFAULT]:"
read _ANS
: ${_ANS:=$_DEFAULT}
if [ "$ANS" = "" ];then
case $_ANS in
Y) return 0
;;
N) return 1 ;;
esac
fi
case $_ANS in
Y|y|Yes|YES)
return 0
;;
n|N|No|NO)
return 1
;;
*) echo "answer either Y or N,default is $_DEFAULT"
;;
esac
echo $_ANS
done
}