Yes, there's some built-in inconveniences...
If you "man ls", it will search each directory in the path for variations of "/dir/{man|cat}[CLFnlpo1-8]/ls{.[CLFnlpo1-8]{.z}?}?" plus some extra patterns for sections 3 and 8 .
Only if it doesn't match *any* file, will it go into /usr/share/man/info/EN_US where it will again try several options:
/usr/share/man/info/EN_US/a_doc_lib/cmds
/usr/share/man/info/EN_US/a_doc_lib/cmds/[a-z]_commands/ls.htm{l}? before finally finding /usr/share/man/info/EN_US/a_doc_lib/cmds/l_commands/ls.html
I'm 95% certain that at some point in time, it used to do the right thing (i.e. find the "info" pages in the man directories instead of searching in the end)
Also, if you use a specific (known-not to match) path, MANPATH=/opt/ibm/sysmgt/dsm/man truss man ls > z 2>&1
The man command follows the patterns I've mentioned before, for the following directories:
/usr/share/man <=== Oi ? That wasn't in the MANPATH !!!
/usr/dt/man <=== Same here
/opt/ibm/sysmgt/dsm/man <== The one in the MANPATH
/usr/share/man/info/EN_US <== Not in the MANPATH either.
The real MANPATH seems to be /usr/share/man:/usr/dt/man:$MANPATH:/usr/share/man/info/EN_US where the last one is searched for the html version.
All of this is in "man man" (except /usr/dt/man), but no-one ever reads the manual pages (including myself)
I think you should open a PMR (not following the MANPATH is a bug) as this makes it impossible to set PATH and MANPATH and still get "man somecommand" to make any sense.
------------------------------
José Pina Coelho
IT Specialist at Kyndryl
------------------------------
Original Message:
Sent: Sat April 16, 2022 12:40 AM
From: Michael Metts
Subject: how to add toolbox to MANPATH in a sane way...
Hi,
I have an AIX 7.3 system (but I think this applies equally to AIX 7.2) on which we're running DNF with the toolbox and all is well with that. On this machine, I would like /opt/freeware/share/man and /opt/freeware/man to be found by the man pages so if I were to say
$ man wget
... I would get some useful output. On the other hand, if I say
$ man ls
... on this particular machine (and several others like it) I would still like the AIX-native man page for the AIX-native ls command to appear. To be clear, I don't always want it this way as we have some users that don't even know they're on AIX. Their shell is bash and /opt/freeware/bin is ahead of /usr/bin in $PATH so for those folks
$ man ls
... should give the pages for GNU ls.
I've been playing with MANPATH a bit attempting to change it in ~/.profile and discovered that it does not behave like I would expect. For instance, it doesn't even exist as an environment variable natively and if you leave it that way you just get the AIX native things.
While I'm at it, I have something special in /usr/local/bin with pages in /usr/local/share/man that I'd also like to throw on the end to be found. How do I get control of this thing. it seems like there's something embedded someplace. Can it be changed? To be really clear, if I put this in ~/.profile
export MANPATH=/usr/local/share/man:/usr/share/man:/usr/opt/man:/usr/lpp/X11/man:/opt/freeware/man:/opt/freeware/share/man
... and then I say
$ man ls
... I get the GNU ls MAN pages and not the AIX MAN pages which if you look at what I have there is somewhat counterintuitive. The logic of MANPATH traversal or whatever it's called does not work the way I would expect. I freely admit that I don't know what I'm doing with this and need help.
Can I add thing I want and/or put things in the order I want? How? Please advise.
Thanks,
Mike
------------------------------
Michael Metts
------------------------------