Chinaunix首页 | 论坛 | 博客
  • 博客访问: 440300
  • 博文数量: 88
  • 博客积分: 2677
  • 博客等级: 少校
  • 技术积分: 893
  • 用 户 组: 普通用户
  • 注册时间: 2009-06-13 08:01
文章分类

全部博文(88)

文章存档

2017年(3)

2016年(1)

2012年(4)

2011年(4)

2010年(57)

2009年(19)

我的朋友

分类: LINUX

2011-01-01 06:18:48

今天遇到个问题,平常不注意;突然遇到,到感觉很疑惑。

安装一个软件BIND9
prefix=/data/bind-9.7.1-P1/

文件夹列表,如下:
/data/bind-9.7.1-P1/
.
|-- bin
|-- etc
|-- include
|   |-- bind9
|   |-- dns
|   |-- dst
|   |-- isc
|   |-- isccc
|   |-- isccfg
|   `-- lwres
|-- lib
|-- sbin
|-- share
|   `-- man
|       |-- man1
|       |-- man3
|       |-- man5
|       `-- man8
`-- var
    `-- run

那么,
/data/bind-9.7.1-P1/的bin/和sbin/下都是相关的可执行文件,
share/man/下都是这些新的可执行文件的man手册。

当然,为了使这些新的可执行文件,能够在shell(bash)下正常工作,自然要更改$PATH变量了.。
#For DNS (BIND9)
PATH=/data/bind-9.7.1-P1/bin:/data/bind-9.7.1-P1/sbin:${PATH}


那么,其对应的man文件如何追加到manpath中呢??

修改$PATH前:
lb@ubuntu:~$ manpath
/usr/local/man:/usr/local/share/man:/usr/share/man

修改$PATH后:
lb@ubuntu:~$ manpath
/data/bind-9.7.1-P1/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man

只改了$PATH就可以????
不必更改$MANPATH(ubuntu中默认没有这个变量,但可自行追加),也不必更改/etc/manpath.conf ??

/etc/manpath.conf 中,都是静态的指定,并不存在动态变量。
看来只有翻看一下手册了。

man命令和manpath命令的手册:

原来是man命令把这个变量读取实施进去了(man命令开发者想的很周到)
man命令会根据shell环境中的$PATH变量来,搜索符合linux的FHS中规定的man手册存放的相对路径。

手动指定man命令的搜索path:
-M path
Specify the list of directories to search for man pages. Separate the directories with colons. An empty list is the same as not specifying -M at all. See SEARCH PATH FOR MANUAL PAGES.
...
...
...

Search Path For Manual Pages

...
...
Furthermore, the MANPATH_MAP statements add to the search path depending on your command search path (i.e. your PATH environment variable). For each directory that may be in the command search path, a MANPATH_MAP statement specifies a directory that should be added to the search path for manual page files. man looks at the PATH variable and adds the corresponding directories to the manual page file search path. Thus, with the proper use of MANPATH_MAP, when you issue the command man xyz, you get a manual page for the program that would run if you issued the command xyz.
...
...
...






阅读(2943) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~