# # @(#)smail.prompt 2.5 (smail) 9/15/87 # loop=true while test $loop = true do case "$1" in string) echo "$2" 1>&2 read ans if test ! -z "$ans" then echo $ans loop=false; fi ;; file) echo "$2" 1>&2 read ans case "$ans" in /*) if test -f "$ans" then echo $ans loop=false; else echo "file '$ans' not found" 1>&2 fi ;; *) echo "must give FULL PATH to file" 1>&2 ;; esac ;; yesno) echo "$2" 1>&2 read ans case "$ans" in y|Y|yes|Yes|YES) echo "yes" loop=false ;; n|N|no|No|NO) echo "no" loop=false ;; *) echo "Please enter yes or no" 1>&2 ;; esac ;; *) echo "usage: $0 string|yesno prompt_message" 1>&2 echo BOGUS_PROMPT_STRING loop=false ;; esac done