Less misbehaves when used for "man" pager...

Marc Unangst mju at mudos.ann-arbor.mi.us
Fri Apr 26 18:02:11 AEST 1991


fields-doug at CS.YALE.EDU (Doug Fields) writes:
> of pg, and you try to read a un-formatted man page (I installed the TPS
> from Xenix on my Unix), less will spew out a ton of warnings about things
> the terminal can't do, such as scroll backwards, etc. This has happened from
> both SCO products, 3.2.2 Unix and 2.3.3 Xenix. Is the TERM environment variab
> somehow misplaced or something?

Sort of.  If you look closely at how man does things, you'll notice
that when it has to format a man page, it hands all the commands it
uses "TERM=dumb" and then filters the output through "col -b".  This
is, I suppose, to keep the output suitable for display on a video
terminal.  Unfortunately, this means that "less" thinks your terminal
is dumb, which causes it to complain.  (To supress this complaint, use
"less -d", assuming your version of less supports it.)  Unfortunately,
it also means that if man formats a man page, the resultant formatted
copy will not have underlining or boldfacing in it, so "less" won't
display them.  (Neither will "more", for that matter.)

The solution, under Xenix, is to do something like this from /usr/man:

for i in man.*
do	cd $i
	c=`echo $i | sed 's/man/cat/'`
	for j in *
	do	if [ ! -f ../$c/$j ]
		then	nroff -man $j >../$c/$j
			pack ../$c/$j
		fi
	done
	cd ..
done

This will step through all of your man.* directories, format any man
pages that haven't yet been formatted, and then run "pack" on them so
they take up less space.  (You really should use "compress" instead,
but SCO man(1) doesn't understand .Z by default, and also doesn't
include compress with Xenix.  If you have Xenix, where man(1) is a
shell script, you can add .Z support, and use compress if you have
it.  If you have Unix, you're SOL unless you want to rip out SCO's
version of man and replace it with something of your own invention.)
If you want to format all the man pages, not just the ones that
haven't yet been formatted, simply take out the if statement that
checks for the formatted man page.

--
Marc Unangst               |
mju at mudos.ann-arbor.mi.us  | "Bus error: passengers dumped"
...!hela!mudos!mju         | 



More information about the Comp.unix.sysv386 mailing list