nl(1) CLIX nl(1)
NAME
nl - Runs a line numbering filter
SYNOPSIS
nl [-htype] [-btype] [-ftype] [-vstart#] [-iincr] [-p] [-lnum] [-ssep] [-
wwidth] [-nformat] [-dxx] file
FLAGS
-btype Specifies which logical page body lines are to be numbered.
The default type for logical page body is t (text lines
numbered). Recognized types and their meaning are:
a
Number all lines
t
Number lines with printable text only
n
No line numbering
pstring
Number only lines that contain the regular expression
specified in string.
-htype Same as -btype except for header. The default type for logical
page header is n (no lines numbered).
-ftype Same as -btype except for footer. The default for logical page
footer is n (no lines numbered).
-vstart# The start# variable is the initial value used to number logical
page lines. The default is 1.
-iincr The incr value is the one that determines how many lines to
increment at one time when numbering logical page lines. The
default is 1.
-p Prevents nl from restarting numbering at logical page
delimiters.
-lnum The num variable determines the number of blank lines to be
considered as one. For example, -l2 results in only the second
adjacent blank being numbered (if the appropriate -ha, -ba,
and/or -fa flag is set). The default is 1.
-ssep The character(s) represented by sep is (are) used in separating
the line number and the corresponding text line. The default
2/94 - Intergraph Corporation 1
nl(1) CLIX nl(1)
sep is a <Tab> character.
-wwidth The width value is the number of characters to be used for the
line number. The default width is 6.
-nformat The format variable determines the line numbering format.
Recognized values are:
ln left justified, leading zeros suppressed
rn right justified, leading zeros suppressed
rz right justified, leading zeros kept The default format is
rn (right justified).
-dxx The delimiter characters specifying the start of a logical page
section may be changed from the default characters (\:) to two
user-specified characters. If only one character is entered,
the second character remains the default character (:). No
space should appear between the -d and the delimiter
characters. To enter a backslash, use two backslashes.
DESCRIPTION
The nl command reads lines from the named file, or stdin if no file is
named, and reproduces the lines on stdout. Lines are numbered on the left
according to the command flags in effect.
The nl command 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, no numbering of header and footer
lines while numbering blank lines only in the body).
The start of logical page sections are signaled by input lines containing
nothing but the following delimiter character(s):
Line contents
Start of
\:\:\: header
\:\: body
\: footer
Unless the flags specify otherwise, nl assumes the text being read is in a
single logical page body.
EXAMPLES
2 Intergraph Corporation - 2/94
nl(1) CLIX nl(1)
The following command will number file1 starting at line number 10 with an
increment of ten. The logical page delimiters are !+.
nl -v10 -i10 -d!+ file1
DIAGNOSTICS
cannot open file filename
The file has incorrect permissions or does not exist.
EXIT VALUES
The nl command exits with a value of 1 if unsuccessful and an
indeterminate value if successful.
RELATED INFORMATION
Commands: pr(1)
2/94 - Intergraph Corporation 3