|HP-UX Reference > N
HP-UX 11i Version 3: February 2007
nl — line numbering filter
nl [-b type] [-h type] [-f type] [-p] [-v start#] [-i incr] [-s sep] [-w width] [-n format] [-l num] [-d delim] [file]
nl reads lines from the named file or the standard input if no file is named and reproduces the lines on the standard output. Lines are numbered on the left in accordance with the command options in effect.
nl 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 (e.g., 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):
Unless told otherwise, nl assumes the text being read is in a single logical page body.
Command options can appear in any order and can be intermingled with an optional file name. Only one file can be named. nl recognizes the following options:
For information about the UNIX Standard environment, see standards(5).
LC_COLLATE determines the collating sequence used in evaluating regular expressions.
LC_CTYPE determines the characters matched by character class expressions in regular expressions.
If LC_COLLATE or LC_CTYPE is not specified in the environment or is set to the empty string, the value of LANG is used as a default for each unspecified or empty variable. If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG.
If any internationalization variable contains an invalid setting, nl behaves as if all internationalization variables are set to "C". See environ(5).
Number file1 starting at line number 10, using an increment of ten. The logical page delimiters are ! and +:
nl -v10 -i10 -d!+ file1