2014-12-04 08:49:07 -05:00
|
|
|
.Dd December 4, 2014
|
2015-01-31 08:20:02 -05:00
|
|
|
.Dt NL 1
|
2015-01-31 14:37:03 -05:00
|
|
|
.Os sbase
|
2014-12-04 08:49:07 -05:00
|
|
|
.Sh NAME
|
|
|
|
.Nm nl
|
|
|
|
.Nd line numbering filter
|
|
|
|
.Sh SYNOPSIS
|
2015-01-30 15:17:58 -05:00
|
|
|
.Nm
|
2014-12-04 08:49:07 -05:00
|
|
|
.Op Fl b Ar type
|
|
|
|
.Op Fl i Ar incr
|
|
|
|
.Op Fl s Ar sep
|
|
|
|
.Op Ar file
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
reads lines from the named
|
|
|
|
.Ar file
|
2015-01-31 08:43:27 -05:00
|
|
|
and writes them to stdout with non-empty lines numbered. If no
|
|
|
|
.Ar file
|
|
|
|
is given
|
2014-12-04 08:49:07 -05:00
|
|
|
.Nm
|
|
|
|
reads from stdin.
|
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Fl b Ar type
|
|
|
|
Defines which lines will be numbered:
|
|
|
|
.Bl -tag -width pstringXX
|
|
|
|
.It a
|
|
|
|
All lines.
|
|
|
|
.It n
|
|
|
|
No lines.
|
|
|
|
.It t
|
|
|
|
Only non-empty lines (default).
|
|
|
|
.It p Ns Ar expr
|
|
|
|
Only lines which match
|
|
|
|
.Ar expr ,
|
2011-05-29 16:30:44 -04:00
|
|
|
a regular expression as defined in
|
2015-01-30 15:17:58 -05:00
|
|
|
.Xr regex 7
|
2014-12-04 08:49:07 -05:00
|
|
|
.El
|
|
|
|
.It Fl i Ar incr
|
|
|
|
Defines the increment between numbered lines.
|
|
|
|
.It Fl s Ar sep
|
2015-01-31 08:43:27 -05:00
|
|
|
Defines the string used to separate line numbers and lines. By default this is
|
2011-05-29 16:30:44 -04:00
|
|
|
a tab.
|
2014-12-04 08:49:07 -05:00
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
|
|
|
.Xr pr 1
|