xref: /netbsd-src/usr.bin/man/man.conf.5 (revision 4472dbe5e3bd91ef2540bada7a7ca7384627ff9b)
1.\"	$NetBSD: man.conf.5,v 1.8 2000/05/27 21:33:26 jdolecek Exp $
2.\"
3.\" Copyright (c) 1989, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"	@(#)man.conf.5	8.5 (Berkeley) 1/2/94
35.\"
36.Dd January 2, 1994
37.Dt MAN.CONF 5
38.Os
39.Sh NAME
40.Nm man.conf
41.Nd configuration file for
42.Xr man 1
43.Sh DESCRIPTION
44The
45.Xr man 1 ,
46.Xr apropos 1 ,
47and
48.Xr whatis 1
49commands
50search for manual pages or their database files as specified by the
51.Nm
52file.
53Manual pages are normally expected to be preformatted (see
54.Xr nroff 1 )
55and named with a trailing ``.0''.
56.Pp
57The
58.Nm
59file contains two types of lines.
60.Pp
61The first type of line is a ``section'' line, which contains a
62section name followed by one or more directory paths.
63The directory paths may contain the normal shell globbing characters,
64including curly braces (``{}''); to escape a shell globbing character,
65precede it with a backslash (``\e'').
66Lines in this format specify that manual pages for the section
67may be found in the following directories.
68.Pp
69Section lines may contain either absolute directory paths or relative
70directory paths (but not both).  Relative directory paths are treated
71as a list of subdirectories to append to the current directory search
72path.  Section lines with absolute directory paths (starting with
73``/'') completely replace the current directory search path with their
74content.  Absolute directory paths named with a trailing slash
75character are expected to contain subdirectories of manual pages, (see
76the keyword ``_subdir'' below) instead of man pages.  These
77subdirectories are searched instead of the directory.
78.Pp
79Before searching any directory for a manual page, the
80.Xr man 1
81command always searches the subdirectory with the same name
82as the current machine type, if it exists.
83No specification of these subdirectories is necessary in the
84.Nm
85file.
86.Pp
87Section names are unrestricted except for the reserved words specified
88below; in general, you should avoid anything with a leading underscore
89(``_'') to avoid future incompatibilities.
90.Pp
91The section named ``_default'' is the list of directories that will
92be searched if no section is specified by the user.
93.Pp
94The second type of line is preceded with a ``keyword''.
95The possible keywords and their meanings are as follows:
96.Pp
97.Bl -tag -width "_version"
98.It _build
99Man file names, regardless of their format, are expected to end in
100a ``.*'' pattern, i.e. a ``.'' followed by some suffix.
101The first field of a _build line lists a suffix which indicates
102files which need to be reformatted or manipulated in some way before
103being displayed to the user.
104The suffix may contain the normal shell globbing characters (NOT
105including curly braces (``{}'')).
106The rest of the line must be a shell command line, the standard
107output of which is the manual page in a format which may be directly
108displayed to the user.
109Any occurrences of the string ``%s'' in the shell command line will
110be replaced by the name of the file which is being reformatted.
111.It _crunch
112The ``_crunch'' section is used by catman to know how to crunch cat pages
113which originally were compressed man pages: The first field lists a suffix
114which indicates what kind of compression were used to compress the man page.
115The rest of the line must be a shell command line, used to compress the
116formatted pages.
117.It _subdir
118The list (in search order) of subdirectories which will be searched in
119any directory named with a trailing slash (``/'') character.
120This list is also used when a path is specified to the
121.Xr man 1
122utility by the user, using the
123.Ev MANPATH
124environment variable or the
125.Fl M
126and
127.Fl m
128options.
129.It _suffix
130Man file names, regardless of their format are expected to end in
131a ``.*'' pattern, i.e. a ``.'' followed by some suffix.
132Each field of a _suffix line is a suffix which indicates
133files which do not need to be reformatted or manipulated
134in any way, but which may be directly displayed to the user.
135Each suffix may contain the normal shell globbing characters (NOT
136including curly braces (``{}'')).
137.It _version
138The version of the configuration file.
139.It _whatdb
140The full pathname (not just a directory path) for a database to be used
141by the
142.Xr apropos 1
143and
144.Xr whatis 1
145commands.
146.El
147.Pp
148Multiple specifications for all types of lines are cumulative and the
149entries are used in the order listed in the file; multiple entries may
150be listed per line, as well.
151.Pp
152Empty lines or lines whose first non-whitespace character is a hash
153mark (``#'') are ignored.
154.Sh EXAMPLES
155Given the following
156.Nm
157file:
158.Bd -literal -offset indent
159_version	BSD.2
160_subdir		cat[123]
161_suffix		.0
162_build		.[1-9]	nroff -man %s
163_build		.tbl	tbl %s | nroff -man
164_default	/usr/share/man/
165sect3		/usr/share/man/{old/,}cat3
166.Ed
167.Pp
168By default, the command
169.Dq Li man mktemp
170will search for
171``mktemp.<any_digit>'' and ``mktemp.tbl''
172in the directories
173.Dq Pa /usr/share/man/cat1 ,
174.Dq Pa /usr/share/man/cat2 ,
175and
176.Dq Pa /usr/share/man/cat3 .
177If on a machine of type ``vax'', the subdirectory ``vax'' in each
178directory would be searched as well, before the directory was
179searched.
180.Pp
181If ``mktemp.tbl'' was found first, the command
182.Dq Li tbl <manual page> | nroff -man
183would be run to build a man page for display to the user.
184.Pp
185The command
186.Dq Li man sect3 mktemp
187would search the directories
188.Dq Pa /usr/share/man/old/cat3
189and
190.Dq Pa /usr/share/man/cat3 ,
191in that order, for
192the mktemp manual page.
193If a subdirectory with the same name as the current machine type
194existed in any of them, it would be searched as well, before each
195of them were searched.
196.Sh FILES
197.Bl -tag -width /etc/man.conf -compact
198.It Pa /etc/man.conf
199Standard manual directory search path.
200.El
201.Sh SEE ALSO
202.Xr apropos 1 ,
203.Xr machine 1 ,
204.Xr man 1 ,
205.Xr whatis 1 ,
206.Xr whereis 1 ,
207.Xr fnmatch 3 ,
208.Xr glob 3
209