LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   MANPATH weirdness (https://www.linuxquestions.org/questions/debian-26/manpath-weirdness-431658/)

johnMG 04-04-2006 12:28 PM

MANPATH weirdness
 
I keep an ~/opt directory for local software installs. It's got an ~/opt/local/man directory in it, along with some man pages (for example, nedit.man and nc.man).

I'm trying to set my MANPATH to include /home/john/opt/local/man, but although the environment variable is getting set, man still won't find those man pages. That is, if I set my MANPATH like so:
Code:

export MANPATH=/home/john/opt/local/man:$MANPATH
I still can't just run "man nc" to get that man page (I've got to use the -l option and specify the full path to that man page).

Also confusing is this: why does the default .bash_profile use the shell syntax:
Code:

MANPATH=~/man${MANPATH:-:}
?

That ${MANPATH:-:} means (according to the bash man page) to put in $MANPATH, or else, if $MANPATH isn't set, to just put in a colon. (?) That looks like a bug to me...

Finally -- and this seems pretty weird -- if I do:
Code:

export MANPATH=/home/john/opt/local/man
then man can no longer find any of its pages. Even though, previously, $MANPATH was empty!

Can anyone explain this weirdness?

Thanks.

johnMG 04-04-2006 12:39 PM

Ok, well, for one thing, I now see from manpath(1) that the extra colon in my $MANPATH is significant, so there is method to the ${MANPATH:-:} madness.

johnMG 04-04-2006 12:47 PM

Alright. If I set MANPATH in ~/.bash_profile like so
Code:

export MANPATH=/home/john/opt/local/man${MANPATH:-:}
then the output of the manpath command tells me:
Code:

manpath: warning: $MANPATH set, appending /etc/manpath.config
/home/john/opt/local/man:/home/john/opt/local/man:/usr/local/man:/usr/local/share/man:/usr/share/man:/usr/X11R6/man

Note that it's showing /home/john/opt/local/man *twice*. Very odd...


All times are GMT -5. The time now is 12:31 PM.