Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Don't forget to add the following line to your .bash<whatever> to make the man pages of your custom software accessible:

    export MANPATH=/usr/local/share/man:$MANPATH
This works for packages installed with homebrew and othe software that follows the standards.


Thanks! I didn't know there was such a thing as $MANPATH!

But, I don't think it's necessary. I don't have `/usr/local/share/man` in my $MANPATH (I don't have a $MANPATH at all, as a matter of fact), yet `man sl` works (and by running `sudo opensnoop` in another shell process I verified that groff indeed pulled the data from `/usr/local/share/man/man1/sl.1`)

(OS X 10.8.1)


You are correct:

  $ man man
    . . .
  man uses a sophisticated method of finding manual page files, based  on
  the   invocation   options   and   environment   variables,  the  /pri-
  vate/etc/man.conf configuration file, and some built in conventions and
  heuristics.
    . . .
  $ fgrep local/share/man /private/etc/man.conf 
  MANPATH	/usr/local/share/man
  MANPATH_MAP	/usr/local/bin		/usr/local/share/man
  MANPATH_MAP	/usr/local/sbin		/usr/local/share/man
  $
(OS X 10.8.n, for some unannounced future value of n, but AFAIK this behavior is unchanged since 10.4 Tiger)


You're right. Good to know that man checks this path by default. I'm using a custom path for homebrew, that's why I added /usr/local/homebrew/share/man to the $MANPATH.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: