ask()
## Interactive Input ###
## ${1} = Default value [Y/N] ##
## $(2) = Message ##
{
    DEFAULT=${1}
    MESSAGE=${2}
    
    while true
    do
	echo -n "${MESSAGE}"
	read INPUT
	if [ ! -n "${INPUT}" ]; then
	    if [ ${DEFAULT} = "Y" ]; then
		return 0
	    else
		return 1
	    fi
	fi
	if [[ ${INPUT:0:1} == "Y" ]] || [[ ${INPUT:0:1} == "y" ]]; then
	    return 0 
	elif [[ ${INPUT:0:1} == "N" ]] || [[ ${INPUT:0:1} == "n" ]]; then
	    return 1
	fi
    done
}

if ask "N" "Hello"; then
    echo "Yes"
else
    echo "No"
fi
			    
