#!/bin/sh
EXIT=0
LINES="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23"
MORE="--More--"
while (exit $EXIT)
do
	for i in $LINES
	do
		if read line
		then
			case "$line" in
			"")	break;;
			*)	echo "$line";;
			esac
		else
			EXIT=1
			break
		fi
	done
	case $EXIT in
	0)	echo -n "$MORE"
		MORE="--More--"
		char="`onechar -n < /dev/tty`"
		echo -n "
                                                                               
"
		case "$char" in
		"")	# Enter
			LINES=1;;
		" ")	LINES="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23";;
		d)	LINES="1 2 3 4 5 6 7 8 9 10 11";;
		q)	EXIT=1
			break;;
		*)	LINES=
			MORE="Press Enter (next line), Space (next page), d (next half-page), or q (quit)"
		esac
		;;
	esac
done < $1
