Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: _man and manpath



> I thought that was intentional.

It's possible; however, on Debian's man, at least, they are not
necessarily identical.

In the manpath manpage:

       MANPATH
              If $MANPATH is  set,  manpath  displays  its  value
              rather than determining it on the fly.  If $MANPATH
              is prefixed by a colon, then the value of the vari­
              able  is  appended  to the list determined from the
              content of the configuration files.  If  the  colon
              comes at the end of the value in the variable, then
              the determined list is appended to the  content  of
              the   variable.   If  the  value  of  the  variable
              contains a double colon (::), then  the  determined
              list  is  inserted  in  the  middle  of  the value,
              between the two colons.


So if a user sets MANPATH=:~/localmanpages, manpath will return
/usr/local/man:/usr/share/man:/usr/X11R6/man:/usr/man:/home/user/localmanpages
but $manpath will be (/home/user/localmanpages).

In this instance, $(manpath) is more useful.  Obviously, if there is a
system where $MANPATH is accurate and $(manpath) isn't, this will be
suboptimal.



Messages sorted by: Reverse Date, Date, Thread, Author