1.\" $NetBSD: man.conf.5,v 1.15 2002/09/30 10:32:16 grant 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 June 26, 2001 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 , 47.Xr whatis 1 48and 49.Xr makewhatis 8 50commands 51search for manual pages or their database files as specified by the 52.Nm 53file. 54Manual pages are normally expected to be preformatted (see 55.Xr nroff 1 ) 56and named with a trailing 57.Dq \.0 . 58.Pp 59The 60.Nm 61file contains two types of lines. 62.Pp 63The first type of line is a 64.Dq section 65line, which contains a 66section name followed by one or more directory paths. 67The directory paths may contain the normal shell globbing characters, 68including curly braces 69.Pq Dq {} ; 70to escape a shell globbing character, 71precede it with a backslash 72.Pq Dq \e . 73Lines in this format specify that manual pages for the section 74may be found in the following directories. 75.Pp 76Section lines may contain either absolute directory paths or relative 77directory paths (but not both). 78Relative directory paths are treated 79as a list of subdirectories to append to the current directory search 80path. 81Section lines with absolute directory paths (starting with 82.Dq / ) 83completely replace the current directory search path with their 84content. 85Absolute directory paths named with a trailing slash 86character are expected to contain subdirectories of manual pages, (see 87the keyword 88.Dq _subdir 89below) instead of man pages. 90These 91subdirectories are searched instead of the directory. 92.Pp 93Before searching any directory for a manual page, the 94.Xr man 1 95command always searches the subdirectory with the same name 96as the current machine type, if it exists. 97No specification of these subdirectories is necessary in the 98.Nm 99file. 100.Pp 101Section names are unrestricted except for the reserved words specified 102below; in general, you should avoid anything with a leading underscore 103.Pq Dq _ 104to avoid future incompatibilities. 105.Pp 106The section named 107.Dq _default 108is the list of directories that will 109be searched if no section is specified by the user. 110.Pp 111The second type of line is preceded with a 112.Dq keyword . 113The possible keywords and their meanings are as follows: 114.Pp 115.Bl -tag -width "_version" 116.It _build 117Man file names, regardless of their format, are expected to end in 118a 119.Dq \.* 120pattern, i.e. a 121.Dq \&\. 122followed by some suffix. 123The first field of a _build line lists a suffix which indicates 124files which need to be reformatted or manipulated in some way before 125being displayed to the user. 126The suffix may contain the normal shell globbing characters (NOT 127including curly braces 128.Pq Dq {} ) . 129The rest of the line must be a shell command line, the standard 130output of which is the manual page in a format which may be directly 131displayed to the user. 132Any occurrences of the string 133.Dq %s 134in the shell command line will 135be replaced by the name of the file which is being reformatted. 136.It _crunch 137The 138.Dq _crunch 139section is used by catman to know how to crunch cat pages 140which originally were compressed man pages: The first field lists a suffix 141which indicates what kind of compression were used to compress the man page. 142The rest of the line must be a shell command line, used to compress the 143formatted pages. 144.It _subdir 145The list (in search order) of subdirectories which will be searched in 146any directory named with a trailing slash 147.Pq Dq / 148character. 149This list is also used when a path is specified to the 150.Xr man 1 151utility by the user, using the 152.Ev MANPATH 153environment variable or the 154.Fl M 155and 156.Fl m 157options. 158.It _suffix 159Man file names, regardless of their format are expected to end in 160a 161.Dq \.* 162pattern, i.e. a 163.Dq \&\. 164followed by some suffix. 165Each field of a _suffix line is a suffix which indicates 166files which do not need to be reformatted or manipulated 167in any way, but which may be directly displayed to the user. 168Each suffix may contain the normal shell globbing characters (NOT 169including curly braces 170.Pq Dq {} ) . 171.It _version 172The version of the configuration file. 173.It _whatdb 174The full pathname (not just a directory path) for a database to be used 175by the 176.Xr apropos 1 177and 178.Xr whatis 1 179commands. 180The pathname may contain the normal shell globbing characters, 181including curly braces 182.Pq Dq {} ; 183to escape a shell globbing character, 184precede it with a backslash 185.Pq Dq \e . 186.El 187.Pp 188Multiple specifications for all types of lines are cumulative and the 189entries are used in the order listed in the file; multiple entries may 190be listed per line, as well. 191.Pp 192Empty lines or lines whose first non-whitespace character is a hash 193mark 194.Pq Dq # 195are ignored. 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 EXAMPLES 202Given the following 203.Nm 204file: 205.Bd -literal -offset indent 206_version BSD.2 207_subdir cat[123] 208_suffix .0 209_build .[1-9] nroff -man %s 210_build .tbl tbl %s | nroff -man 211_default /usr/share/man/ 212sect3 /usr/share/man/{old/,}cat3 213.Ed 214.Pp 215By default, the command 216.Dq Li man mktemp 217will search for 218.Dq mktemp.\*[Lt]any_digit\*[Gt] 219and 220.Dq mktemp.tbl 221in the directories 222.Dq Pa /usr/share/man/cat1 , 223.Dq Pa /usr/share/man/cat2 , 224and 225.Dq Pa /usr/share/man/cat3 . 226If on a machine of type 227.Dq vax , 228the subdirectory 229.Dq vax 230in each 231directory would be searched as well, before the directory was 232searched. 233.Pp 234If 235.Dq mktemp.tbl 236was found first, the command 237.Dq Li tbl \*[Lt]manual page\*[Gt] | nroff -man 238would be run to build a man page for display to the user. 239.Pp 240The command 241.Dq Li man sect3 mktemp 242would search the directories 243.Dq Pa /usr/share/man/old/cat3 244and 245.Dq Pa /usr/share/man/cat3 , 246in that order, for 247the mktemp manual page. 248If a subdirectory with the same name as the current machine type 249existed in any of them, it would be searched as well, before each 250of them were searched. 251.Sh SEE ALSO 252.Xr apropos 1 , 253.Xr machine 1 , 254.Xr man 1 , 255.Xr whatis 1 , 256.Xr whereis 1 , 257.Xr fnmatch 3 , 258.Xr glob 3 , 259.Xr makewhatis 8 260