1 .\" $NetBSD: nl.1,v 1.9 2008/04/30 13:11:01 martin Exp $
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 or the standard input if the
78 applies a configurable line numbering filter operation and writes the result
79 to the standard output.
83 utility treats the text it reads in terms of logical pages.
84 Unless specified otherwise, line numbering is reset at the start of each
86 A logical page consists of a header, a body and a footer section; empty
88 Different line numbering options are independently available for header,
89 body and footer sections.
91 The starts of logical page sections are signaled by input lines containing
92 nothing but one of the following sequences of delimiter characters:
94 .Bd -unfilled -offset indent
95 .Bl -column "\e:\e:\e: " "header "
96 .It Em "Line" "Start of"
103 If the input does not contain any logical page section signaling directives,
104 the text being read is assumed to consist of a single logical page body.
106 The following options are available:
107 .Bl -tag -width indent
109 Specify the logical page body lines to be numbered.
113 .Bl -tag -width pstringXX
117 Number only non-empty lines.
121 Number only those lines that contain the basic regular expression specified
128 for logical page body lines is t.
130 Specify the delimiter characters used to indicate the start of a logical
131 page section in the input file.
132 At most two characters may be specified; if only one character is specified,
133 the first character is replaced and the second character remains unchanged.
136 characters are ``\e:''.
140 except for logical page footer lines.
143 for logical page footer lines is n.
147 except for logical page header lines.
150 for logical page header lines is n.
152 Specify the increment value used to number logical page lines.
157 If numbering of all lines is specified for the current logical section
158 using the corresponding
167 specify the number of adjacent blank lines to be considered as one.
170 2 results in only the second adjacent blank line being numbered.
175 Specify the line numbering output format.
179 .Bl -tag -width lnXX -compact
183 Right justified, leading zeros suppressed.
185 Right justified, leading zeros kept.
192 Specify that line numbering should not be restarted at logical page delimiters.
194 Specify the characters used in separating the line number and the corresponding
198 setting is a single tab character.
200 Specify the initial value used to number logical page lines; see also the
208 Specify the number of characters to be occupied by the line number;
211 is insufficient to hold the line number, it will be truncated to its
213 least significant digits.
221 utility exits 0 on success, and \*[Gt]0 if an error occurs.
229 with the exception of not supporting the intermingling of the
231 operand with the options, which the standard considers an obsolescent feature
232 to be removed from a further issue.
236 utility first appeared in