sbase/nl.1

98 lines
1.7 KiB
Groff
Raw Normal View History

.Dd March 27, 2015
.Dt NL 1
.Os sbase
2014-12-04 13:49:07 +00:00
.Sh NAME
.Nm nl
.Nd line numbering filter
.Sh SYNOPSIS
.Nm
2015-03-18 16:58:09 +00:00
.Op Fl p
2014-12-04 13:49:07 +00:00
.Op Fl b Ar type
2015-03-18 16:58:09 +00:00
.Op Fl d Ar delim
.Op Fl f Ar type
.Op Fl h Ar type
.Op Fl i Ar num
2015-03-10 11:49:56 +00:00
.Op Fl l Ar num
2015-02-20 14:12:03 +00:00
.Op Fl n Ar format
2014-12-04 13:49:07 +00:00
.Op Fl s Ar sep
.Op Fl v Ar num
.Op Fl w Ar num
2014-12-04 13:49:07 +00:00
.Op Ar file
.Sh DESCRIPTION
.Nm
reads lines from
2014-12-04 13:49:07 +00:00
.Ar file
and writes them to stdout, numbering non-empty lines.
If no
.Ar file
is given
2014-12-04 13:49:07 +00:00
.Nm
reads from stdin.
.Sh OPTIONS
.Bl -tag -width Ds
2015-03-18 16:58:09 +00:00
.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:
2014-12-04 13:49:07 +00:00
.Bl -tag -width pstringXX
.It a
All lines.
.It n
No lines.
.It t
Only non-empty lines. This is the default.
2014-12-04 13:49:07 +00:00
.It p Ns Ar expr
Only lines matching
.Ar expr
according to
2015-02-01 19:52:28 +00:00
.Xr regex 7 .
2014-12-04 13:49:07 +00:00
.El
2015-03-18 16:58:09 +00:00
.It Fl d Ar delim
Set
.Ar delim
as the delimiter for logical pages. If
.Ar delim
2015-03-22 16:25:11 +00:00
is only one character,
.Nm
appends ":" to it. The default is "\e:".
.It Fl i Ar num
Set the increment between numbered lines to
.Ar num .
2015-03-10 11:49:56 +00:00
.It Fl l Ar num
Set the number of adjacent blank lines to be considered as one to
.Ar num .
The default is 1.
2015-02-20 14:12:03 +00:00
.It Fl n Ar format
Set the line number output
2015-02-20 14:12:03 +00:00
.Ar format
to one of:
2015-02-20 14:12:03 +00:00
.Bl -tag -width pstringXX
.It ln
Left justified.
.It rn
Right justified. This is the default.
2015-02-20 14:12:03 +00:00
.It rz
Right justified with leading zeroes.
.El
2014-12-04 13:49:07 +00:00
.It Fl s Ar sep
Use
.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 .
2015-02-20 12:15:43 +00:00
The default is 6.
2014-12-04 13:49:07 +00:00
.El
.Sh SEE ALSO
.Xr pr 1
2015-03-18 16:58:09 +00:00
.Sh STANDARDS
The
.Nm
utility is compliant with the
.St -p1003.1-2013
2015-03-18 16:58:09 +00:00
specification.