103 lines
1.7 KiB

.Dd 2015-10-08
.Dt NL 1
.Os sbase
.Nm nl
.Nd line numbering filter
.Op Fl p
.Op Fl b Ar type
.Op Fl d Ar delim
.Op Fl f Ar type
.Op Fl h Ar type
.Op Fl i Ar num
.Op Fl l Ar num
.Op Fl n Ar format
.Op Fl s Ar sep
.Op Fl v Ar num
.Op Fl w Ar num
.Op Ar file
reads lines from
.Ar file
and writes them to stdout, numbering non-empty lines.
If no
.Ar file
is given
reads from stdin.
.Bl -tag -width Ds
.It Fl p
Do not reset line number for logical pages.
.It Fl h Ar type | Fl b Ar type | Fl f Ar type
Define which lines to number in the head | body | footer section:
.Bl -tag -width pstringXX
.It a
All lines.
.It n
No lines.
.It t
Only non-empty lines.
This is the default.
.It p Ns Ar expr
Only lines matching
.Ar expr
according to
.Xr regex 7 .
.It Fl d Ar delim
.Ar delim
as the delimiter for logical pages.
.Ar delim
is only one character,
appends ":" to it.
The default is "\e:".
.It Fl i Ar num
Set the increment between numbered lines to
.Ar num .
.It Fl l Ar num
Set the number of adjacent blank lines to be considered as one to
.Ar num .
The default is 1.
.It Fl n Ar format
Set the line number output
.Ar format
to one of:
.Bl -tag -width pstringXX
.It ln
Left justified.
.It rn
Right justified.
This is the default.
.It rz
Right justified with leading zeroes.
.It Fl s Ar sep
.Ar sep
to separate line numbers and lines.
The default is "\et".
.It Fl v Ar num
Start counting lines from
.Ar num .
The default is 1.
.It Fl w Ar num
Set the width of the line number to
.Ar num .
The default is 6.
.Xr pr 1
utility is compliant with the
.St -p1003.1-2013