on-line manual pages on sys V?

Barry Shein bzs at BU-CS.BU.EDU
Thu Sep 4 06:58:54 AEST 1986


My SYSV system has on-line manuals right off the tape (3Bx/SYSVR2),
maybe you better tell us exactly what machine/release is involved.

At any rate, no, it's trivial as long as you have the manuals themselves
on-line already. In fact, if you have the 4.2bsd 'man' command it will
more or less just work (you may have to customize it a little in the
header according to where you keep your manual entries.)

In fact, the older systems just used a shell script, note that if you
keep the formatted (nroff'd) versions on-line, it's not much more than

	# whatever program you use to paginate to the screen
	PAGER=pg
	# the base name for the formatted manual directory
	MANDIR=/usr/man/cat

	for i in 1 2 3 4 5 6 7 8 l
	do
		if [ -f $MANDIR$i/$1.$i ]
		then
			$PAGER $MANDIR$i/$1.$i
			exit 0
		fi
	done
	# if we found the page we would have exited, so must not have it
	echo Sorry, no manual page for $1
	exit 1

Which you could obviously fancy-up with accepting multiple pages on one
command and checking for an unformatted version and filtering it through
nroff, etc etc.

The keyword stuff (apropos or 'man -k') is a little hairier, you build
an index and essentially grep that, no big deal tho.

	-Barry Shein, Boston University



More information about the Comp.unix.wizards mailing list