freebsd-dev/usr.sbin/xntpd/refclocks/setupfn
1993-12-21 18:36:48 +00:00

28 lines
399 B
Plaintext

#
# sh io functions
#
if [ "`echo -n`" = "-n" ]; then
echon () { echo "$@\\c"; }
else
echon () { echo -n "$@"; }
fi
query() {
_Q="$1"
_A="$2"
echon "$_Q (y/n) [$_A] ? "
X=""
read X
if [ "$X" = "" ]; then
X="$_A"
fi
case "$X" in
[yY]*) return 0;;
*) return 1;;
esac
}
check () {
`echo "$1" | awk '{ if ( '"$2"' ) { print ":"; } else { print "false"; } exit; }'`;
}