.\" Man page for format of the manpath.config data file .\" .\" Copyright (C) 1994, 1995 Graeme W. Wilford. (Wilf.) .\" Copyright (C) 2001-2019 Colin Watson. .\" .\" You may distribute under the terms of the GNU General Public .\" License as specified in the file COPYING that comes with the .\" man-db distribution. .\" .\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk) .\" .pc "" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH MANPATH 5 2022-02-10 2.10.1 /etc/manpath.config .SH 名称 manpath \- 格式化 /etc/manpath.config 文件 .SH 描述 manpath 配置文件是手册页工具程序用来在运行时访问用户的 manpath 的。它指示了哪些手册页层次结构(manpath)应视为系统层次结构,并向它们分配用于保存 cat 文件的目录。 如果已经设置了环境变量 $\fBMANPATH\fP,/etc/manpath.config 中包含的信息不会覆盖它。 .SH 搜索路径 By default, man\-db examines the user's $\fBPATH\fP. For each \fIpath_element\fP found there, it adds \fImanpath_element\fP to the search path. If there is no \fBMANPATH_MAP\fP line in the configuration file for a given \fIpath_element\fP, then it adds all of \fIpath_element/../man\fP, \fIpath_element/man\fP, \fIpath_element/../share/man\fP, and \fIpath_element/share/man\fP that exist as directories to the search path. It then adds any \fBMANDATORY_MANPATH\fP entries from the configuration file to the search path. Finally, if the \fB\-\-systems\fP option is used or the $\fBSYSTEM\fP environment variable is set, then that should consist of a sequence of operating system names separated by commas or colons. This acts as a template, expanding the search path once more to allow access to other operating systems' manual pages: for each system name, man\-db looks for that name as a subdirectory of each entry in the search path, and adds it to the final search path if it exists. A system name of \fBman\fP inserts the normal search path without subdirectories. For example, if the search path would otherwise have been \fI/usr/share/man:/usr/local/man\fP, and $\fBSYSTEM\fP is set to \fInewOS:man\fP, then the final search path will be \fI/usr/share/man/newOS:/usr/share/man:/usr/local/man/newOS:/usr/local/man\fP. The $\fBMANPATH\fP environment variable overrides man\-db's default manual page search paths. Most users should not need to set it. Its syntax is similar to the $\fBPATH\fP environment variable: it consists of a sequence of directory names separated by colons. It overrides the default search path described above. If the value of $\fBMANPATH\fP starts with a colon, then the default search path is added at its start. If the value of $\fBMANPATH\fP ends with a colon, then the default search path is added at its end. If the value of $\fBMANPATH\fP contains a double colon (\fB::\fP), then the default search path is inserted in the middle of the value, between the two colons. .SH 格式 当前支持以下字段类型: .TP \fB#\fP\fI\ 注释\fP 空行或以 \fB#\fP 开头的行将视为注释并忽略。 .TP \fBMANDATORY_MANPATH\fP\fI\ manpath_element\fP 这种形式的行指定每个自动生成的 $\fBMANPATH\fP 应包含的 manpath。它通常包含 \fI/usr/man\fP。 .TP \fBMANPATH_MAP\fP\fI\ path_element\ manpath_element\fP 这种形式的行将设置 $\fBPATH\fP 到 $\fBMANPATH\fP 的映射。对于在用户 $\fBPATH\fP 中找到的每个 \fIpath_element\fP,会将 \fImanpath_element\fP 添加到 $\fBMANPATH\fP。 .TP \fBMANDB_MAP \fP\fImanpath_element \fP\|[\| \fIcatpath_element\fP \|] 这种形式的行指示哪些 manpath 视为系统 manpath,还可指定它们的 cat 文件保存在哪里。如果 \fBman\fP 是一个 setuid 程序,此字段类型将尤为重要,因为(当在系统配置文件 /etc/manpath.config 而不是每个用户配置文件 .manpath 中时)它指示哪些手册页层次结构作为 setuid 用户访问,哪些作为调用用户访问。 系统手册页层次结构通常保存在 \fI/usr\fP 下,如 \fI/usr/man\fP, \fI/usr/local/man\fP 和 \fI/usr/X11R6/man\fP。 如果来自某个特定 \fImanpath_element\fP 的 cat 页面不保存,或保存在传统位置,可以忽略 \fIcatpath_element\fP。 Traditional cat placement would be impossible for read only mounted manual page hierarchies and because of this it is possible to specify any valid directory hierarchy for their storage. To observe the \fBLinux FSSTND\fP the keyword \fBFSSTND\fP can be used in place of an actual directory. 不幸的是,需要指定 \fB所有\fP 系统 man 目录树的路径,包括替代的操作系统路径,如 \fI/usr/man/sun\fP 和任何的 \fBNLS 区域语言\fP 路径,如 \fI/usr/man/de_DE.88591\fP。 由于是按写的顺序逐行解析的,因此必须先列出作为另一层次结构的次级结构的 manpath,否则会出现不正确的匹配。例如,\fI/usr/man/de_DE.88591\fP 应出现在 \fI/usr/man\fP 之前。 .TP \fBDEFINE\fP\fI\ 键\ 值\fP 这种形式的行定义各种配置变量;请查看默认的配置文件了解手册分页工具使用了哪些变量。它们包括指向各种程序的路径(如 \fIgrep\fP 和 \fItbl\fP),和这些程序的默认参数集。 .TP \fBSECTION\fP \fI章节\fP .\|.\|. .RS 这种形式的行定义手册章节的搜索顺序。如果配置文件中没有 \fBSECTION\fP 指令,默认为: .PP .RS .nf .if !'po4a'hide' SECTION 1 n l 8 3 0 2 5 4 9 6 7 .fi .RE .PP 如果给出了多个 \fBSECTION\fP 指令,它们的章节列表会被合并。 .PP 如果某个特定扩展不在列表中(像 1mh),它会和它所属章节的其他部分一起显示。这样的效果是,若要强制某种特定的顺序,您只需明确列出扩展。带扩展的章节通常应该与其主章节相邻(如“1 1mh 8 ...)。 .PP \fBSECTIONS\fP 是此指令的替代名称,也允许使用。 .RE .TP \fBMINCATWIDTH\fP\fI\ 宽度\fP 如果终端宽度小于 \fI宽度\fP,将不会创建(若缺少)或显示 cat 页面。默认值为 80。 .TP \fBMAXCATWIDTH\fP\fI\ 宽度\fP 如果终端宽度大于 \fI宽度\fP,将不会创建(若缺少)或显示 cat 页面。默认值为 80。 .TP \fBCATWIDTH\fP\fI\ 宽度\fP 如果 \fI宽度\fP 是非零的,对指定宽度的终端将总是格式化 cat 页面,不管实际使用的终端宽度是多少。此数值通常应在 \fBMINCATWIDTH\fP 和 \fBMAXCATWIDTH\fP 设置的范围之内。 .TP .if !'po4a'hide' .B NOCACHE 此标志阻止 \fBman\fP(1) 自动创建 cat 页面。 .SH BUGS 除非完全准确的遵守了这些规则,否则手册分页工具会工作不正常。这些规则过于复杂了。 .PP .if !'po4a'hide' https://gitlab.com/cjwatson/man-db/-/issues .br .if !'po4a'hide' https://savannah.nongnu.org/bugs/?group=man-db