xref: /csrg-svn/usr.bin/man/man.conf.5 (revision 65297)
163032Sbostic.\" Copyright (c) 1989, 1991, 1993
263032Sbostic.\"	The Regents of the University of California.  All rights reserved.
340896Ssklower.\"
449645Scael.\" %sccs.include.redist.roff%
540896Ssklower.\"
6*65297Sbostic.\"	@(#)man.conf.5	8.5 (Berkeley) 01/02/94
740896Ssklower.\"
849645Scael.Dd
949645Scael.Dt MAN.CONF 5
1050471Scael.Os
1149645Scael.Sh NAME
1249645Scael.Nm man.conf
1349645Scael.Nd configuration file for
1449645Scael.Xr man 1
1549645Scael.Sh DESCRIPTION
1649645ScaelThe
1749645Scael.Xr man 1 ,
1849645Scael.Xr apropos 1 ,
1942402Sbosticand
2049645Scael.Xr whatis 1
2149645Scaelcommands
2242402Sbosticsearch for manual pages or their database files as specified by the
2349645Scael.Nm man.conf
2442402Sbosticfile.
2565294SbosticManual pages are normally expected to be preformatted (see
2649645Scael.Xr nroff 1 )
2742402Sbosticand named with a trailing ``.0''.
2849645Scael.Pp
2940896SsklowerThe
3049645Scael.Nm man.conf
3142402Sbosticfile contains two types of lines.
3249645Scael.Pp
3342402SbosticThe first type of line is a ``section'' line, which contains a
3465294Sbosticsection name followed by one or more directory paths.
3565294SbosticThe directory paths may contain the normal shell globbing characters,
3665294Sbosticincluding curly braces (``{}''); to escape a shell globbing character,
3765294Sbosticprecede it with a backslash (``\e'').
3842402SbosticLines in this format specify that manual pages for the section
3965296Sbosticmay be found in the following directories.
4049645Scael.Pp
4142402SbosticDirectories named with a trailing slash character (``/'') are expected
4265294Sbosticto contain subdirectories of manual pages, (see the keyword ``_subdir''
4365294Sbosticbelow) instead of manual pages.
4442402SbosticThese subdirectories are searched instead of the directory.
4549645Scael.Pp
4665294SbosticBefore searching any directory for a manual page, the
4749645Scael.Xr man 1
4865294Sbosticcommand always searches the subdirectory with the same name
4965294Sbosticas the current machine type, if it exists.
5042402SbosticNo specification of these subdirectories is necessary in the
5149645Scael.Nm man.conf
5242402Sbosticfile.
5349645Scael.Pp
5442402SbosticSection names are unrestricted except for the reserved words specified
5565294Sbosticbelow; in general, you should avoid anything with a leading underscore
5665294Sbostic(``_'') to avoid future incompatibilities.
5749645Scael.Pp
5865294SbosticThe section named ``_default'' is the list of directories that will
5965294Sbosticbe searched if no section is specified by the user.
6049645Scael.Pp
6142402SbosticThe second type of line is preceded with a ``keyword''.
6242402SbosticThe possible keywords and their meanings are as follows:
6349645Scael.Pp
6450471Scael.Bl -tag -width "_version"
6565294Sbostic.It _build
6665294SbosticMan file names, regardless of their format, are expected to end in
6765294Sbostica ``.*'' pattern, i.e. a ``.'' followed by some suffix.
6865295SbosticThe first field of a _build line lists a suffix which indicates
6965295Sbosticfiles which need to be reformated or manipulated in some way before
7065295Sbosticbeing displayed to the user.
7165295SbosticThe suffix may contain the normal shell globbing characters (NOT
7265295Sbosticincluding curly braces (``{}'')).
7365294SbosticThe rest of the line must be a shell command line, the standard
7465294Sbosticoutput of which is the manual page in a format which may be directly
7565294Sbosticdisplayed to the user.
7665296SbosticAny occurrences of the string ``%s'' in the shell command line will
7765296Sbosticbe replaced by the name of the file which is being reformatted.
7849645Scael.It _subdir
7942402SbosticThe list (in search order) of subdirectories which will be searched in
8065294Sbosticany directory named with a trailing slash (``/'') character.
8165294SbosticThis list is also used when a path is specified to the
8265294Sbostic.Xr man 1
8365294Sbosticutility by the user, using the
8449645Scael.Ev MANPATH
8565294Sbosticenvironment variable or the
8649645Scael.Fl M
8765294Sbosticand
8865294Sbostic.Fl m
8965294Sbosticoptions.
9065294Sbostic.It _suffix
9165294SbosticMan file names, regardless of their format are expected to end in
9265294Sbostica ``.*'' pattern, i.e. a ``.'' followed by some suffix.
9365295SbosticEach field of a _suffix line is a suffix which indicates
9465295Sbosticfiles which do not need to be reformatted or manipulated
9565294Sbosticin any way, but which may be directly displayed to the user.
9665295SbosticEach suffix may contain the normal shell globbing characters (NOT
9765295Sbosticincluding curly braces (``{}'')).
9849645Scael.It _version
9942402SbosticThe version of the configuration file.
10049645Scael.It _whatdb
10142402SbosticThe full pathname (not just a directory path) for a database to be used
10242402Sbosticby the
10349645Scael.Xr apropos 1
10442402Sbosticand
10549645Scael.Xr whatis 1
10642402Sbosticcommands.
10749645Scael.El
10849645Scael.Pp
10965294SbosticMultiple specifications for all types of lines are cumulative and the
11065294Sbosticentries are used in the order listed in the file; multiple entries may
11165294Sbosticbe listed per line, as well.
11249645Scael.Pp
11342402SbosticEmpty lines or lines whose first non-whitespace character is a hash
11442402Sbosticmark (``#'') are ignored.
11549645Scael.Sh EXAMPLES
11642402SbosticGiven the following
11749645Scael.Nm man.conf
11849645Scaelfile:
11949645Scael.Bd -literal -offset indent
120*65297Sbostic_version	BSD.2
12165294Sbostic_subdir		cat[123]
12265294Sbostic_suffix		.0
12365294Sbostic_build		.[1-9]	nroff -man %s
12465294Sbostic_build		.tbl	tbl %s | nroff -man
12549645Scael_default	/usr/share/man/
12665294Sbosticsect3		/usr/share/man/{old/,}cat3
12749645Scael.Ed
12849645Scael.Pp
12965294SbosticBy default, the command
13065294Sbostic.Dq Li man mktemp
13165294Sbosticwill search for
13265294Sbostic``mktemp.<any_digit>'' and ``mktemp.tbl''
13365294Sbosticin the directories
13465294Sbostic.Dq Pa /usr/share/man/cat1 ,
13565294Sbostic.Dq Pa /usr/share/man/cat2 ,
13665294Sbosticand
13765294Sbostic.Dq Pa /usr/share/man/cat3 .
13865294SbosticIf on a machine of type ``vax'', the subdirectory ``vax'' in each
13965294Sbosticdirectory would be searched as well, before the directory was
14065294Sbosticsearched.
14149645Scael.Pp
14265294SbosticIf ``mktemp.tbl'' was found first, the command
14365294Sbostic.Dq Li tbl <manual page> | nroff -man
14465294Sbosticwould be run to build a man page for display to the user.
14565294Sbostic.Pp
14649645ScaelThe command
14765294Sbostic.Dq Li man sect3 mktemp
14865294Sbosticwould search the directories
14965294Sbostic.Dq Pa /usr/share/man/old/cat3
15049645Scaeland
15165294Sbostic.Dq Pa /usr/share/man/cat3 ,
15249645Scaelin that order, for
15365294Sbosticthe mktemp manual page.
15442402SbosticIf a subdirectory with the same name as the current machine type
15565294Sbosticexisted in any of them, it would be searched as well, before each
15665294Sbosticof them were searched.
15749645Scael.Sh FILES
15849645Scael.Bl -tag -width /etc/man.conf -compact
15949645Scael.It Pa /etc/man.conf
16049645ScaelStandard manual directory search path.
16149645Scael.El
16249645Scael.Sh SEE ALSO
16349645Scael.Xr apropos 1 ,
16449645Scael.Xr machine 1 ,
16549645Scael.Xr man 1 ,
16649645Scael.Xr whatis 1 ,
16765295Sbostic.Xr whereis 1 ,
16865295Sbostic.Xr fnmatch 3 ,
16965295Sbostic.Xr glob 3
170