Sunday, November 27, 2005

How to create MAN Pages in AIX

Purpose (was aixmanpages

This document describes a simple method for creating man pages on an AIX system so you can document locally created programs.

Steps
  1. You need system privileges on the AIX server to do this. Sign in.

  2. If there is no directory called /usr/share/man/man1, create it. It should have 755 rights (chmod 755 man1)

  3. For each command you want to document, create a file in the man1 directory called command.1. where command is the name of the command.

  4. Enter the man page in nroff format in this file. See the sample file section for an example.

  5. Run man on the file from any user (man foo). This will parse the file and place the output in /usr/share/man/cat1 as parsed nroff. It will also display the man page.

Formatting






The following nroff commands can be helpful:
CommandPurpose
.THTable Header
.SHSection Header
.SSSub-section
.TPTable Point (list item)
fBStart Bold
fPStart Plain


Sample nroff file

.TH CI 1 "21 February 05"
.SH NAME
check_server - Check an AIX server
.SH SYNOPSIS
fBcheck_serverfP [ -e -p ] [aix_server]
.SH DESCRIPTION
fBcheck_serverfP attempts to connect to an AIX
server. If there is no error, it returns
a message that the server passed. If not,
it returns a message that the server failed,
and optionally can send emails, a page, or both
to alert the sysadmins of the problem.

If there is an error and a message is sent to
the sysadmins, the ORA- error is included with the message.

If no server is specified, a usage message is produced.

If neither fB-efP nor fB-pfP are specified, output
is sent to the screen only, to avoid sending erroneous
pages.
.SS Options
.TP
fB-efP
send error results to the sysadmins via email.
.TP
fB-pfP
send error results to the sysadmins via pager.
.SH FILES
.TP
fC/usr/local/bin/check_server.logsfR
A directory containing the error logs for each AIX server.
.SH "SEE ALSO"
adm_emails(1)
.SH AUTHOR
Timothy Chen Allen, , 504.555.1212
.SH BUGS
If the server specified does not exist or is mispelled,
fBcheck_serverfP will attempt to connect to it anyway. This is
generally not a problem, since fBcheck_serverfP is normally run
from a crontab. However, for this reason, fBcheck_serverfP
normally should not be run from the command line with the
fB-pfP flag, to avoid sending erroneous pages.

No comments:

Post a Comment

I moderate comments blog posts over 14 days old. This keeps a lot of spam away. I generally am all right about moderating. Thanks for understanding.