在 osx 中找不到手册页(manpath 问题)

在 osx 中找不到手册页(manpath 问题)

我使用的是 OSX 10.8.3,但我的手册页没有显示。我在使用 10.6 时也遇到过这个问题,但我不想修复它。

我找不到手册页的原因是它被设置为“/usr/local/texlive/2011/texmf/doc/man”。我想找出答案在哪里正在设置它(下面的清单显示正在通过 cat 命令设置它)。手册页存在于一堆目录中(如下所示),但由于路径仅设置为一个位置,因此 man 找不到它们。我的 shell 是 bash。

我查看了 /etc/profile ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc 和 ~/.MacOSX/environment.plist,没有看到任何与 manpath 相关的内容。

以下是一些相关信息:

macosx@sh ~ $  > manpath
/usr/local/texlive/2011/texmf/doc/man

macosx@sh ~ $  > man -v
man, version 1.6c

macosx@sh ~ $  > uname -a
Darwin sh.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan  6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64

macosx@sh ~ $  > man -d man
Reading config file /private/etc/man.conf
Looked whether there exists a message catalog man, but there is none
(and for English messages none is needed)

found man directory /usr/share/man
found man directory /usr/local/share/man
found man directory /usr/X11/man
found manpath map /bin --> /usr/share/man
found manpath map /sbin --> /usr/share/man
found manpath map /usr/bin --> /usr/share/man
found manpath map /usr/sbin --> /usr/share/man
found manpath map /usr/local/bin --> /usr/local/share/man
found manpath map /usr/local/sbin --> /usr/local/share/man
found manpath map /usr/X11/bin --> /usr/X11/man
found manpath map /usr/bin/X11 --> /usr/X11/man
found manpath map /usr/bin/mh --> /usr/share/man

using /usr/bin/less -is as pager

using /usr/bin/less -is as browser

using /bin/cat to dump HTML pages as textadding /usr/local/texlive/2011/texmf/doc/man to manpath
No manual entry for man


# wanted to ignore commented out lines
macosx@sh ~ $  >cat /private/etc/man.conf | grep -v ^\#  
FHS
MANPATH /usr/share/man
MANPATH /usr/local/share/man
MANPATH /usr/X11/man
MANPATH_MAP /bin            /usr/share/man
MANPATH_MAP /sbin           /usr/share/man
MANPATH_MAP /usr/bin        /usr/share/man
MANPATH_MAP /usr/sbin       /usr/share/man
MANPATH_MAP /usr/local/bin      /usr/local/share/man
MANPATH_MAP /usr/local/sbin     /usr/local/share/man
MANPATH_MAP /usr/X11/bin        /usr/X11/man
MANPATH_MAP /usr/bin/X11        /usr/X11/man
MANPATH_MAP /usr/bin/mh     /usr/share/man
TROFF       /usr/bin/groff -Tps -mandoc -c
NROFF       /usr/bin/groff -Wall -mtty-char -Tascii -mandoc -c
JNROFF      /usr/bin/groff -Tnippon -mandocj -c
EQN     /usr/bin/eqn -Tps
NEQN        /usr/bin/eqn -Tascii
JNEQN       /usr/bin/eqn -Tnippon
TBL     /usr/bin/tbl
REFER       /usr/bin/refer
PIC     /usr/bin/pic
VGRIND      /usr/bin/vgrind
GRAP
PAGER       /usr/bin/less -is
BROWSER     /usr/bin/less -is
HTMLPAGER   /bin/cat
CAT     /bin/cat
CMP     /usr/bin/cmp -s
COMPRESS    /usr/bin/bzip2
COMPRESS_EXT    .bz2
MANSECT     1:1p:8:2:3:3p:4:5:6:7:9:0p:tcl:n:l:p:o
.gz     /usr/bin/gunzip -c
.bz2        /usr/bin/bzip2 -c -d
.z
.Z      /usr/bin/zcat
.F
.Y

所以我找到了这个博客文章在 manpath 上,我看到的是:

macosx@sh ~ $  > cat /etc/profile
# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
    eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
    [ -r /etc/bashrc ] && . /etc/bashrc
fi

macosx@sh ~ $  >  /usr/libexec/path_helper -s
    PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/opt/local/bin:/opt/local/sbin:/usr/local/share/python:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Users/macosx/.gem/bin:/Users/macosx/.gem/ruby/1.8/bin:/usr/local/texlive/2011/bin/universal-darwin:/usr/texbin:/usr/X11/bin:/Users/macosx/.rvm/bin"; export PATH;
MANPATH="/usr/share/man:/usr/local/share/man:/opt/X11/share/man:/usr/local/texlive/2011/texmf/doc/man"; export MANPATH;

因此,使用 path_helper 可以正确设置 manpath,但它在某处被覆盖。

为了澄清起见,我要求在哪里某些东西可能正在重置路径,我想通过正确重置 manpath 可以强制解决问题。我很想知道在哪里manpath 正在被改变。

相关内容