manprint(1) manprint(1)
NAME
manprint - print reference pages on a line printer maintaining page
integrity
SYNOPSIS
manprint [section] title
DESCRIPTION
When working with reference pages, or manpages as they are commonly
called, users from time to time also need to be able to print out a
manpage displayed online with the man(1) command to ease legibility.
The manprint command can be used for this purpose.
manprint sends reference pages to standard output in formatted form.
In this respect, it works in the same way as the man command. In con-
trast, however, you can easily forward the output of the manprint com-
mand to a line printer by means of a pipe and in this way print a man-
page exactly as it was displayed on the screen (e. g. the manpage
diff3(1): manprint diff3 | lp -dlineprinter). It does not make sense
to do this with the output of the man command, because the form feeds
are different with the print output and the screen output and the
resulting print-out does not look very good.
As with the man command, you can specify section identifiers or alias
names as arguments with the manprint command. You should note the fol-
lowing here:
Section identifiers
A manpage can be invoked explicitly with section identifiers with both
the manprint command and the man command. This can be useful if a man-
page exists in several sections under the same title and only differs
in terms of the section identifier. The section identifier can always
be found in round brackets after the title of a manpage or also at the
right and left margin in each header line on the screen. "iconv" is an
example of a manpage with several section identifiers, which exists in
three variants: iconv(1) [user command], iconv(3C) [C function] and
iconv(5) [header file]. If you invoke the manpage with manprint iconv,
all three descriptions are displayed in succession on the screen (or
printed if this has been specified). If, on the other hand, you are
only interested in one of these descriptions - e. g. the one for the C
function -, you have to specify the section identifier before the man-
page title: manprint 3C iconv.
The same applies where there are different versions of manpages, for
example AT&T and Berkeley (UCB). You can also invoke the required
description explicitly in this case. Take, for example, the "chown"
command which exists in two variants, i.e. AT&T [chown(1)] and UCB
[chown(1-ucb)]. If, for example, you are only interested in the UCB
description, you have to invoke the manpage as follows: manprint 1-ucb
chown.
Page 1 Reliant UNIX 5.44 Printed 11/98
manprint(1) manprint(1)
See also under Example 2 and the section NOTES.
Alias names
An alias name occurs if the first entry (= title) in the section NAME
is followed by further titles separated by commas.
You can see examples of such alias names in the string(3C) manpage,
where the primary collective title "string:" is followed by fifteen
other titles of routines (from strcat to strstr). Another typical
example is the enable(1) manpage which also bears the alias name dis-
able.
These alias names are practical from the point of view that a manpage
can be invoked by means of its alias name as well as by its title. The
user therefore does not need to know the title under which a descrip-
tion can be found but can use the alias that is know to him or her. As
a result, the same string(3C) manpage containing the required descrip-
tion is output when you invoke manprint string and manprint strstr.
See also under Example 3.
ARGUMENTS
section A specific section identifier can be specified optionally
for a manpage, e. g. 2, 1M, 3C, 1-ucb, 1M-vxfs etc.
If a section identifier is not specified and if several man-
pages exist with the same title but different section iden-
tifiers, all manpages with this title are output.
title Mandatory specification of a title or alias name for a man-
page, e. g. ksh, rksh, ctype, isalpha etc.
Wildcards should not be used when specifying the title (*,
?).
Note: It is not possible to have two manpages with the same
name that can also have the same section identifier (because
they are printed in different manuals).
EXAMPLES
Example 1: Redirect output to file and print
manprint uniq | tee uniq.man | lp -dlineprinter
The manpage for the uniq(1) command is redirected with tee(1) to the
uniq.man file and printed at the same time on a line printer.
Page 2 Reliant UNIX 5.44 Printed 11/98
manprint(1) manprint(1)
Example 2: Specify section identifier
There are six different manpages for the mount interface: there are
descriptions of the mount command for different file systems (hs, ufs,
vxfs etc.) and a description of the mount(2) system call. Since you
are only interested in the mount command for the Veritas file system,
enter the 1M-vxfs section identifier explicitly as the first argument:
manprint 1M-vxfs mount | lp -dlineprinter
Only the specific Veritas manpage mount(1M-vxfs) will be printed. If
you omitted the 1M-vxfs specification, all 6 mount manpages would have
been printed all at once.
Example 3: Specify alias name
You want to output the description of the logarithm routine log1p but
do not know in which manpage it is described. Nevertheless, you enter:
manprint log1p | lp -dlineprinter
The exp(3M) manpage is printed, which also lists and describes log1p
under several alias names (expf, expm1, cbrt to sqrtf).
NOTES
Font settings (italics and courier) in the manpage text are retained
in the output and are reproduced by the line printer if the printer
supports this, i.e. they are generally printed with underscoring. It
is not recommended, however, to redirect the output to a file and then
to remove the font settings. This could be done easily with the col -b
command. The -b option of the col command removes all escape sequences
[see col(1)]. As a result, all of the escape sequences are also
removed for the form feed and the print output then no longer main-
tains page integrity with the screen output of the man command.
There is one restriction to be noted when specifying a section iden-
tifier (section argument). In the following case, neither man nor man-
print works properly:
manprint 1 echo
The echo manpage with the section identifier "1" [i.e. echo(1)] is not
the only manpage output - as was required - rather the manpages
echo(1-ucb) and echo(1F) are also printed. This means that the section
identifier "1" is expanded inadmissibly. On the other hand, however,
by specifying:
manprint 1-ucb echo
only the required echo(1-ucb) manpage is output.
Page 3 Reliant UNIX 5.44 Printed 11/98
manprint(1) manprint(1)
SEE ALSO
man(1).
Page 4 Reliant UNIX 5.44 Printed 11/98