[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How command "manpath" works?



On Wed, Aug 06, 2003 at 02:51:35PM +0800, Zhao You Bing wrote:
> I downloaded j2sdk from SUN and extracted it to /usr/local
> and I found the /usr/local/j2sdk/man is in the list of command "manpath"
> 
> But I haven't set manpath manully and it's not listed in /etc/manpath.config

If you haven't set $MANPATH manually, then man and friends guess it
based on the value of $PATH. From get_manpath() in the source (and read
/etc/manpath.config for man_db.config here):

/*
 * For each directory in the user's path, see if it is one of the
 * directories listed in the man_db.config file.  If so, and it is
 * not already in the manpath, add it.  If the directory is not listed
 * in the man_db.config file, see if there is a subdirectory `../man' or
 * `man'.  If so, and it is not already in the manpath, add it.
 * Example:  user has $HOME/bin in his path and the directory
 * $HOME/man exists -- the directory $HOME/man will be added
 * to the manpath.
 */

> I'm wondering how manpath works, who can give me a hint or tell me in 
> which package I can found the source code of "manpath" so I can check it 
> myself?

man-db. (I'm the maintainer.)

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: