xref: /original-bsd/usr.bin/man/man.conf.5 (revision 37071c60)
1.\" Copyright (c) 1989, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.roff%
5.\"
6.\"	@(#)man.conf.5	8.5 (Berkeley) 01/02/94
7.\"
8.Dd
9.Dt MAN.CONF 5
10.Os
11.Sh NAME
12.Nm man.conf
13.Nd configuration file for
14.Xr man 1
15.Sh DESCRIPTION
16The
17.Xr man 1 ,
18.Xr apropos 1 ,
19and
20.Xr whatis 1
21commands
22search for manual pages or their database files as specified by the
23.Nm man.conf
24file.
25Manual pages are normally expected to be preformatted (see
26.Xr nroff 1 )
27and named with a trailing ``.0''.
28.Pp
29The
30.Nm man.conf
31file contains two types of lines.
32.Pp
33The first type of line is a ``section'' line, which contains a
34section name followed by one or more directory paths.
35The directory paths may contain the normal shell globbing characters,
36including curly braces (``{}''); to escape a shell globbing character,
37precede it with a backslash (``\e'').
38Lines in this format specify that manual pages for the section
39may be found in the following directories.
40.Pp
41Directories named with a trailing slash character (``/'') are expected
42to contain subdirectories of manual pages, (see the keyword ``_subdir''
43below) instead of manual pages.
44These subdirectories are searched instead of the directory.
45.Pp
46Before searching any directory for a manual page, the
47.Xr man 1
48command always searches the subdirectory with the same name
49as the current machine type, if it exists.
50No specification of these subdirectories is necessary in the
51.Nm man.conf
52file.
53.Pp
54Section names are unrestricted except for the reserved words specified
55below; in general, you should avoid anything with a leading underscore
56(``_'') to avoid future incompatibilities.
57.Pp
58The section named ``_default'' is the list of directories that will
59be searched if no section is specified by the user.
60.Pp
61The second type of line is preceded with a ``keyword''.
62The possible keywords and their meanings are as follows:
63.Pp
64.Bl -tag -width "_version"
65.It _build
66Man file names, regardless of their format, are expected to end in
67a ``.*'' pattern, i.e. a ``.'' followed by some suffix.
68The first field of a _build line lists a suffix which indicates
69files which need to be reformated or manipulated in some way before
70being displayed to the user.
71The suffix may contain the normal shell globbing characters (NOT
72including curly braces (``{}'')).
73The rest of the line must be a shell command line, the standard
74output of which is the manual page in a format which may be directly
75displayed to the user.
76Any occurrences of the string ``%s'' in the shell command line will
77be replaced by the name of the file which is being reformatted.
78.It _subdir
79The list (in search order) of subdirectories which will be searched in
80any directory named with a trailing slash (``/'') character.
81This list is also used when a path is specified to the
82.Xr man 1
83utility by the user, using the
84.Ev MANPATH
85environment variable or the
86.Fl M
87and
88.Fl m
89options.
90.It _suffix
91Man file names, regardless of their format are expected to end in
92a ``.*'' pattern, i.e. a ``.'' followed by some suffix.
93Each field of a _suffix line is a suffix which indicates
94files which do not need to be reformatted or manipulated
95in any way, but which may be directly displayed to the user.
96Each suffix may contain the normal shell globbing characters (NOT
97including curly braces (``{}'')).
98.It _version
99The version of the configuration file.
100.It _whatdb
101The full pathname (not just a directory path) for a database to be used
102by the
103.Xr apropos 1
104and
105.Xr whatis 1
106commands.
107.El
108.Pp
109Multiple specifications for all types of lines are cumulative and the
110entries are used in the order listed in the file; multiple entries may
111be listed per line, as well.
112.Pp
113Empty lines or lines whose first non-whitespace character is a hash
114mark (``#'') are ignored.
115.Sh EXAMPLES
116Given the following
117.Nm man.conf
118file:
119.Bd -literal -offset indent
120_version	BSD.2
121_subdir		cat[123]
122_suffix		.0
123_build		.[1-9]	nroff -man %s
124_build		.tbl	tbl %s | nroff -man
125_default	/usr/share/man/
126sect3		/usr/share/man/{old/,}cat3
127.Ed
128.Pp
129By default, the command
130.Dq Li man mktemp
131will search for
132``mktemp.<any_digit>'' and ``mktemp.tbl''
133in the directories
134.Dq Pa /usr/share/man/cat1 ,
135.Dq Pa /usr/share/man/cat2 ,
136and
137.Dq Pa /usr/share/man/cat3 .
138If on a machine of type ``vax'', the subdirectory ``vax'' in each
139directory would be searched as well, before the directory was
140searched.
141.Pp
142If ``mktemp.tbl'' was found first, the command
143.Dq Li tbl <manual page> | nroff -man
144would be run to build a man page for display to the user.
145.Pp
146The command
147.Dq Li man sect3 mktemp
148would search the directories
149.Dq Pa /usr/share/man/old/cat3
150and
151.Dq Pa /usr/share/man/cat3 ,
152in that order, for
153the mktemp manual page.
154If a subdirectory with the same name as the current machine type
155existed in any of them, it would be searched as well, before each
156of them were searched.
157.Sh FILES
158.Bl -tag -width /etc/man.conf -compact
159.It Pa /etc/man.conf
160Standard manual directory search path.
161.El
162.Sh SEE ALSO
163.Xr apropos 1 ,
164.Xr machine 1 ,
165.Xr man 1 ,
166.Xr whatis 1 ,
167.Xr whereis 1 ,
168.Xr fnmatch 3 ,
169.Xr glob 3
170