[net.unix-wizards] the 'man' command

israel@umcp-cs.UUCP (10/08/83)

I was checking the performance of an 'emacs' interface to the 'man'
command on our 4.1 bsd system, and I found something funny.

When 'man' is run normally, the first thing it does (after finding
the appropriate command and volume) is to see if it has already been
formatted in a /usr/man/cat<n> directory.  If so, it will use that
version instead of nroff'ing it, and pipe it thru 'more'.  If there
isn't one, or it's not up-to-date, it will make the formatted version.

However, I found by experimentation, (and confirmed it by examining
the code) that if the standard out of the man command is not a
teletype, but instead a file or pipe, not only does it skip piping
the output thru more (as one would expect it to) but it also skips
the check for the /usr/man/cat<n> file, and always nroff's the
source text.  In addition, it sends the output to its standard out,
but does not create or update the /usr/man/cat<n> file.

Does anyone know if there is some rational explanation for why it
does this, or has someone made the (probably fairly simple)
modifications for it to behave rationally?
-- 

~~~ Bruce ~~~
Computer Science Dept., University of Maryland
{rlgvax,seismo}!umcp-cs!israel (Usenet)    israel.umcp-cs@Udel-Relay (Arpanet)

serge%ucbcory%berkeley@sri-unix.UUCP (10/23/83)

From:  Serge Granik <serge%ucbcory@berkeley>

	Sorry, but my first reply got garbled.  Now as I was saying,
I think that the man command is simply badly written.  Nevertheless,
I have been able to fix this and some other inherent bugs.  If you
are interested, I think that I can send you the fixed copy.

						serge@ucbcory