man search path

man search path

Post by Jeff Hafer » Sat, 25 Jul 2009 06:18:19



According to the manual page for man (at least on a Centos linux
system), if MANPATH is not set, man searches according to the rules in
/etc/man.config.

However, if MANPATH is set, it over-rides the rules in /etc/man.config.

I'd like to do something like
setenv MANPATH $MANPATH:/another/path

and KEEP the defaults defined in /etc/man.config

However, setting MANPATH overrides whatever is defined in
/etc/man.config

I don't want to edit /etc/man.config because this script will be
tailored for various individuals (i.e., userA is using compilerA,
I want the script to add the path to compilerA to his MANPATH, but doing
this overrides the default paths in /etc/man.config so now he can't even
do a "man ls")

How can I accomplish what I'm trying to do?
 
 
 

man search path

Post by Peter van » Sat, 25 Jul 2009 07:26:23


You don't need to if compilerA is in his $PATH (with unmodified man.config):
[hooft@hosta ~]$ mkdir -p piet/bin piet/man/man1
[hooft@hosta ~]$ touch piet/bin/pqpq piet/man/man1/pqpq.1
[hooft@hosta ~]$ PATH=$PATH:$HOME/piet/bin
[hooft@hosta ~]$ man pqpq
fgets: No such file or directory
Error reading man page /home/hooft/piet/man/man1/pqpq.1
No manual entry for pqpq
[hooft@hosta ~]$

If you have unconventional paths to the man files you can use
MANPATH_MAP in man.config, I suppose.


peter

 
 
 

man search path

Post by jimp » Sat, 25 Jul 2009 07:45:01


I don't use csh, so:

export MANPATH=`manpath -q`:/another/path


--
Jim Pennino

Remove .spam.sux to reply.
 
 
 

man search path

Post by Jeff Hafer » Sun, 26 Jul 2009 08:16:13


Thanks, this is helpful, as is the next post.
 
 
 

man search path

Post by Jeff Hafer » Sun, 26 Jul 2009 08:17:49


My "manpath" command doesn't accept the -q argument, but it looks like
`manpath` alone does the trick... thank you!
 
 
 

man search path

Post by jimp » Sun, 26 Jul 2009 08:45:00


FYI on those that do, -q suppresses extraneous output.


--
Jim Pennino

Remove .spam.sux to reply.