#!/bin/sh

: 'Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 2026.'
:
: 'read yes or no [default no] to message $1'

: 'Determine if echo -n works'
case  `echo -n foo` in
-n*) n="" c='\c';;
*) n=-n c="";;
esac

echo " "
echo $n "$1 [no] $c"
while true
do
	read ans
	case $ans in
	y|Y|t|T|yes|Yes|YES|true|True|TRUE)	exit 0;;
	''|n|N|f|F|no|No|NO|false|False|FALSE)	exit 1;;
	*)		echo "Please answer with yes or no."
			echo $n "$1 [no] $c"
	esac
done
