1 .\" $FreeBSD: head/usr.bin/nl/nl.1 265319 2014-05-04 12:20:40Z pluknet $
3 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
35 .Nd line numbering filter
73 utility reads lines from the named
75 applies a configurable line numbering filter operation,
76 and writes the result to the standard output.
83 reads from the standard input.
87 utility treats the text it reads in terms of logical pages.
88 Unless specified otherwise, line numbering is reset at the start of each
90 A logical page consists of a header, a body and a footer
91 section; empty sections are valid.
92 Different line numbering options are
93 independently available for header, body and footer sections.
95 The starts of logical page sections are signalled by input lines containing
96 nothing but one of the following sequences of delimiter characters:
97 .Bl -column "\e:\e:\e:" "Start of" -offset indent
99 .It "\e:\e:\e: header"
104 If the input does not contain any logical page section signalling directives,
105 the text being read is assumed to consist of a single logical page body.
107 The following options are available:
108 .Bl -tag -width ".Fl v Ar startnum"
110 Specify the logical page body lines to be numbered.
114 .Bl -tag -width indent
118 Number only non-empty lines.
122 Number only those lines that contain the basic regular expression specified
129 for logical page body lines is
132 Specify the delimiter characters used to indicate the start of a logical
133 page section in the input file.
134 At most two characters may be specified;
135 if only one character is specified, the first character is replaced and the
136 second character remains unchanged.
144 except for logical page footer lines.
147 for logical page footer lines is
152 except for logical page header lines.
155 for logical page header lines is
158 Specify the increment value used to number logical page lines.
163 If numbering of all lines is specified for the current logical section
164 using the corresponding
170 specify the number of adjacent blank lines to be considered as one.
173 2 results in only the second adjacent blank line being numbered.
178 Specify the line numbering output format.
182 .Bl -tag -width indent -compact
186 Right justified, leading zeros suppressed.
188 Right justified, leading zeros kept.
196 Specify that line numbering should not be restarted at logical page delimiters.
198 Specify the characters used in separating the line number and the corresponding
202 setting is a single tab character.
204 Specify the initial value used to number logical page lines; see also the
212 Specify the number of characters to be occupied by the line number;
215 is insufficient to hold the line number, it will be truncated to its
217 least significant digits.
224 .Ev LANG , LC_ALL , LC_CTYPE
227 environment variables affect the execution of
244 utility first appeared in
247 Input lines are limited to
249 (2048) bytes in length.