# Simple query library script if [ -z "${__ask_sh_loaded}" ] then __ask_sh_loaded=yes yn() { def="${1:-n}"; shift while true do [ "${#}" -gt 0 ] && printf "${*} " read _res case "${_res:-${def}}" in [Yy]*) return 0 ;; [Nn]*) return 1 ;; *) echo "bad response!"; continue ;; esac done } fi