'\"macro stdmacro
.if n .pH g1.nl @(#)nl	40.9 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} nl 1 "Directory and File Management Utilities" "\&"
.if \nX=1 .ds x} nl 1 "Directory and File Management Utilities"
.if \nX=2 .ds x} nl 1 "" "\&"
.if \nX=3 .ds x} nl "" "" "\&"
.TH \*(x}
.SH NAME
\f4nl\f1 \- line numbering filter
.SH SYNOPSIS
\f4nl\f1
[\f4\-b\f2type\f1]
[\f4\-f\f2type\f1]
[\f4\-h\f2type\f1]
[\f4\-v\f2start#\f1]
[\f4\-i\f2incr\f1]
[\f4\-p\f1]
[\f4\-l\f2num\f1]
[\f4\-s\f2sep\f1]
[\f4\-w\f2width\f1]
[\f4\-n\f2format\f1]
[\f4\-d\f2delim\f1]
[\f2file\f1]
.SH DESCRIPTION
\f4nl\fP
reads lines from the named \f2file\fP, or the
standard input if no \f2file\fP is named, and
reproduces the lines on the standard output.
Lines are numbered on the left in accordance with
the command options in effect.
.P
\f4nl\fP
views the text it reads in terms of logical pages.
Line numbering is reset at the start
of each logical page.
A logical page consists of a
header, a body, and a footer section.
Empty sections are valid.
Different line numbering options
are independently available
for header, body, and footer.
For example, \f4\-bt\fP (the default)
numbers non-blank lines in the body section and does
not number any lines in the header and footer sections.
.P
The start of logical page sections are signaled by input
lines containing nothing but the following delimiter character(s):
.br
.RS 10
.TP 15
.I Line contents\^
.I Start of\^
.TP
\e\|:\|\e\|:\|\e\|:
header
.TP
\e\|:\|\e\|:
body
.TP
\e\|:\|
footer
.sp
.RE
Unless optioned otherwise,
\f4nl\fP
assumes the text being read is in a single logical page body.
.P
Command options may appear in any order and
may be intermingled with an optional file name.
Only one file may be named.
The options are:
.TP 10
\f4\-b\f2type\^\f1
Specifies which logical page body lines are to be numbered.
Recognized \f2type\fPs and their meanings are:
.sp
.ta .5i
.nf
\f4a\f1	number all lines
\f4t\f1	number lines with printable text only
\f4n\f1	no line numbering
\f4p\f2exp\f1	number only lines that contain the regular expression
	specified in \f2exp\f1 (see \f4ed\f1(1))
.fi
.sp
Default \f2type\fP for logical page body is
\f4t\f1
(text lines numbered).
.TP 10
\f4\-f\f2type\^\f1
Same as
\f4\-b\f2type\^\f1
except for footer.
Default \f2type\fP for logical page footer is \f4n\fP
(no lines numbered).
.TP 10
\f4\-h\f2type\^\f1
Same as
\f4\-b\f2type\^\f1
except for header.
Default \f2type\fP for logical page header is \f4n\fP
(no lines numbered).
.TP 10
\f4\-v\f2start#\^\f1
.I start#\^
is the initial value used to 
number logical page lines.
Default \f2start#\fP is
\f41\f1.
.TP 10
\f4\-i\f2incr\^\f1
.I incr\^
is the increment value used
to number logical page lines.
Default \f2incr\fP is
\f41\f1.
.TP 10
\f4\-p\f1
Do not restart numbering at logical page delimiters.
.TP 10
\f4\-l\f2num\^\f1
.I num\^
is the number of blank lines to be
considered as one.
For example,
\f4\-l2\f1
results in only the second adjacent blank
being numbered (if the appropriate
\f4\-ha\f1,
\f4\-ba\f1,
and/or
\f4\-fa\f1
option is set).
Default \f2num\fP is
\f41\f1.
.TP 10
\f4\-s\f2sep\^\f1
.I sep\^
is the character(s) used in
separating the line number and the
corresponding text line.
Default \f2sep\fP is a tab.
.TP 10
\f4\-w\f2width\^\f1
.I width\^
is the number of characters
to be used for the line number.
Default \f2width\fP is
\f46\f1.
.TP 10
\f4\-n\f2format\^\f1
.I format\^
is the line numbering format.
Recognized values are:
\f4ln\f1,
left justified, leading zeroes
suppressed;
\f4rn\f1,
right justified,
leading zeroes suppressed;
\f4rz\f1,
right justified, leading zeroes kept.
Default \f2format\fP is \f4rn\f1 (right justified).
.TP 10
\f4\-d\f2delim\^\f1
The two delimiter characters specifying the start of a logical page
section may be changed from the default characters (\e\|:\|) to
two user-specified characters.
If only one character is entered,
the second character remains the default character (:).
No space should appear between the
\f4\-d\f1
and the delimiter characters.
To enter a backslash, use two backslashes.
.SH EXAMPLE
The command:
.RS 10
.PP
\f4nl \-v10 \-i10 \-d!+ file1\fP
.RE
.PP
will cause the first line of the page body to be numbered \f410\fP,
the second line of the page body to be numbered \f420\fP,
the third \f430\fP, and so forth.
The logical page delimiters are !+.
.SH SEE ALSO
\f4pr\fP(1), \f4ed\fP(1).
.\"	@(#)nl.1	6.2 of 9/2/83
.Ee
