Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
nl(1) OSS Shell and Utilities Reference Manual
2. To number all lines in chap1,enter:
nl -b a chap1
This command numbers all the lines in the body sections, including blank lines. This
form of the nl command is adequate for most uses.
3. To number the lines in chap1 and specify a different line-number format, enter:
nl -i 10 -n rz -s :: -v 10 -w 4 chap1
This command numbers the lines of chap1, starting with 10 (-v 10) and incrementing by
10 (-i 10). It displays four digits for each number (-w 4), right-justified including leading
zeros (-n rz). The line numbers are separated from the text by two colons (-s ::). For
example, if chap1 contains the following text:
A not-so-important note to remember:
You can’t kill time without injuring eternity.
then the numbered listing is as follows:
0010::A not-so-important note to remember:
0020::You can’t kill time without injuring eternity.
Note that the blank line was not numbered. To number the blank line too, use the -b a
flag as shown in Example 2.
RELATED INFORMATION
Commands: cat(1), pr(1).
Files: locale(4).
STANDARDS CONFORMANCE
This command conforms to the XPG4 Version 2 specification.
6−40 Hewlett-Packard Company 527188-003