cd /usr/doc/man
if $1x = x goto nope
	set b = 1
if ! -r man$1 goto sect1
	set b = $1
	shift
: sect1
	if -r /mnt/webb/doc/$1.$b goto man
	if -r man$b/$1.$b goto oldman
	if -r /etc/help/$1 goto ok
	if $b != 1 goto notcmd
	if -r /bin/$1 -o -r /usr/bin/$1 goto iscmd
	echo $1 "is not a command"
	goto loop
: iscmd
: notcmd
	echo "Sorry, manual page" $1 "is not available."
	goto loop
: man
	chdir /mnt/webb/doc
	fmt -term --u $1.$b
	goto loop
: oldman
	chdir man$b
	nroff -mm $1.$b ^ iul
	goto loop
: oldman0
	chdir man$b
	nroff -mm $1 ^ iul
	goto loop
: ok
help $1 </dev/tty
goto loop
: nope
echo "usage: man [section] name"
echo "The following manual pages exist (in form name.section)"
f /mnt/webb/doc
exit
: loop
shift
cd /usr/doc/man
if $1x != x goto sect1
exit
