2 # getans prompt type default results_filename
7 # file default=default filename
9 # yesno default=0,1 corres yes or no
18 if [ ${TYP} = "yesno" ]; then
20 pmpt
="${RAWPMPT} [$ny]: "
22 if [ -z "${DFLT}" ]; then
25 pmpt
="${RAWPMPT} [${DFLT}]: "
28 if [ x
"`echo -n`" = x-n
]
41 tmp
=`echo $input | tr -d 0123456789.`
42 if [ -n "$tmp" ]; then
43 echo "Invalid number. Please try again."
49 tmp
=`echo $input | tr -d 0123456789`
50 if [ -n "$tmp" ]; then
51 echo "Invalid integer. Please try again."
57 if [ "x$input" != "x-1" ]; then
58 tmp
=`echo $input | tr -d 0123456789`
59 if [ -n "$tmp" ]; then
60 echo "Invalid integer. Please try again."
67 if [ -z "$input" ]; then
70 if [ ! -f "$input" -a ! -d "$input" ]; then
71 echo "The file $input does not exist. Please try again."
77 if [ -z "$input" ]; then
80 if [ ! -f "$input" ]; then
81 path
=`echo $PATH | sed -e s'/::/ . /g' -e 's/:/ /g'`
84 if [ -f "$elt/$input" ]; then x
=1; break; fi
87 echo "The command $input was not found. Please try again."
94 if [ -z "$input" ]; then
103 echo 'Please answer "yes" or "no".'
114 if [ -z "$input" ]; then
118 echo $input > ${OFNM}