*BSD News Article 1919


Return to BSD News archive

Xref: sserve comp.unix.programmer:5834 comp.unix.bsd:1954
Path: sserve!manuel!munnari.oz.au!spool.mu.edu!caen!nic.umass.edu!amherst!amhux1.amherst.edu!twpierce
From: twpierce@amhux1.amherst.edu (Tim Pierce)
Newsgroups: comp.unix.programmer,comp.unix.bsd
Subject: Hard Links, and Possible "man" Bug
Message-ID: <1992Jul14.211906.24151@amhux2.amherst.edu>
Date: 14 Jul 92 21:19:06 GMT
Article-I.D.: amhux2.1992Jul14.211906.24151
Sender: usenet@amhux2.amherst.edu (USENET News System)
Followup-To: poster
Organization: Amherst College, Amherst MA
Lines: 28
Nntp-Posting-Host: amhux1.amherst.edu

I've found (though I'm sure I'm not the only one) what I consider to
be a bug in our DEC-supplied BSD man.  We're running Ultrix V4.2 (Rev.
96) on a DECstation 3100.

My problem with man started when I noticed that on our system,
supplying the full pathname when invoking "apropos" or "whatis" causes
these programs to behave as if you'd invoked "man" instead.

Looking into this irregularity further, it was pointed out to me that
apropos, whatis, and man are all linked to a single binary.  Upon
invocation, this program first checks the name of the command that
invoked it, and if "apropos" or "whatis" calls the routines executed
by "man -k" and "man -f".  However, since I'd supplied the full
pathname for apropos, man found that the string "/usr/ucb/apropos" was
unequal to the strings "apropos" or "whatis" and assumed that I had
invoked man.

I've fixed the problem locally, but it led me to wonder about the
advantages of linking together distinct programs like these.  I can
understand it in the case of different programs which perform _very_
similar functions, but apropos and whatis work very differently from
man.  So apart from saving a little disk space, why link them together
rather than writing separate programs to perform these functions?

-- 
____ Tim Pierce                / "You mean there are TWO of you, Pierce?
\  / twpierce@amherst.edu      /  God help us all."
 \/ (BITnet: TWPIERCE@AMHERST) /   -- Major Charles Emerson Winchester III