System Admin  «Prev 

Preformatted man Pages in Unix

The manual pages are written in an old-fashioned text formatting language called nroff, and the man program pipes the pages through a converter to make them readable. To save processing time, the system saves preformatted versions of the manual pages after you use them for the first time. Therefore, when you first use a man page, you will notice that it takes some time to format the page. The system stores these pages and refers to them upon each subsequent request. You can delete these pages, or you can issue the -c option, which reformats pages.

Here is a brief manual page source file for the wgrep command, which can also serve as a template for manual pages you might create:
.TH wgrep l
.SH NAME
wgrep - windowed grep utility
.SH SYNOPSIS
wgrep [options] regexp file(s)
.SH DESCRIPTION
.B wgrep
is a
.B grep
utility which prints a window of lines surrounding
each matching line that it finds in the list of files.
By default, the window is three lines before and after
each matching line.
.PP
.B wgrep
has many options which control how its output looks.
It can range from plain to painfully excessive.
.SH OPTIONS
.TP 5
.B -w
Specifies the window size in the form
.B before:after Either one can be omitted.
.TP 5
.B -n
Include line numbers before each printed line.
.TP 5
.B -s
Include asterisks in front of matching lines.
.PP
.SH BUGS
None of course.
.SH SEE ALSO
egrep(1), VMS SEARCH command

catman Utility

The catman utility creates the preformatted versions of the on-line manual from the nroff(1) or sgml(5) input files.
This feature allows easy distribution of the preformatted manual pages among a group of associated machines, since it makes the directories of pre-formatted manual pages self-contained and independent of the unformatted entries.
catman also creates the windex database file in the directories specified by the MANPATH or the -M option.
The windex database file is a three column list consisting of a keyword, the reference page that the keyword points to, and a line of text that describes the purpose of the utility or interface documented on the reference page.
Each keyword is taken from the comma separated list of words on the NAME line before the `-' (dash). The reference page that the key-word points to is the first word on the NAME line. The text after the - on the NAME line is the descriptive text in the third column. The NAME line must be immediately preceded by the page heading line created by the .TH macro.
Each manual page is examined and those whose preformatted versions are missing or out of date are recreated.
If any changes are made, catman recreates the windex database.

Unix System Administration