File:  [MW Coherent from dump] / coherent / a / tmp / smail / utils / smail.prompt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:34 2019 UTC (7 years, 2 months ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

#
# @(#)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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.