1 .\" $FreeBSD: src/usr.bin/nl/nl.1,v 1.8.2.3 2002/07/15 06:18:43 tjr Exp $
2 .\" $DragonFly: src/usr.bin/nl/nl.1,v 1.4 2008/05/02 02:05:07 swildner Exp $
4 .\" Copyright (c) 1999 The NetBSD Foundation, Inc.
5 .\" All rights reserved.
7 .\" This code is derived from software contributed to The NetBSD Foundation
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
17 .\" documentation and/or other materials provided with the distribution.
18 .\" 3. All advertising materials mentioning features or use of this software
19 .\" must display the following acknowledgement:
20 .\" This product includes software developed by the NetBSD
21 .\" Foundation, Inc. and its contributors.
22 .\" 4. Neither the name of The NetBSD Foundation nor the names of its
23 .\" contributors may be used to endorse or promote products derived
24 .\" from this software without specific prior written permission.
26 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 .\" POSSIBILITY OF SUCH DAMAGE.
38 .Dd September 20, 2001
43 .Nd line numbering filter
81 utility reads lines from the named
83 or the standard input if the
86 applies a configurable line numbering filter operation and writes the result
87 to the standard output.
91 utility treats the text it reads in terms of logical pages.
92 Unless specified otherwise, line numbering is reset at the start of each
93 logical page. A logical page consists of a header, a body and a footer
94 section; empty sections are valid. Different line numbering options are
95 independently available for header, body and footer sections.
97 The starts of logical page sections are signalled by input lines containing
98 nothing but one of the following sequences of delimiter characters:
99 .Bl -column "\e:\e:\e:" "Start of" -offset indent
101 .It "\e:\e:\e: header"
106 If the input does not contain any logical page section signalling directives,
107 the text being read is assumed to consist of a single logical page body.
109 The following options are available:
110 .Bl -tag -width ".Fl v Ar startnum"
112 Specify the logical page body lines to be numbered.
116 .Bl -tag -width indent
120 Number only non-empty lines.
124 Number only those lines that contain the basic regular expression specified
131 for logical page body lines is
134 Specify the delimiter characters used to indicate the start of a logical
135 page section in the input file. At most two characters may be specified;
136 if only one character is specified, the first character is replaced and the
137 second character remains unchanged.
145 except for logical page footer lines.
148 for logical page footer lines is
153 except for logical page header lines.
156 for logical page header lines is
159 Specify the increment value used to number logical page lines.
164 If numbering of all lines is specified for the current logical section
165 using the corresponding
171 specify the number of adjacent blank lines to be considered as one.
174 2 results in only the second adjacent blank line being numbered.
179 Specify the line numbering output format.
183 .Bl -tag -width indent -compact
187 Right justified, leading zeros suppressed.
189 Right justified, leading zeros kept.
197 Specify that line numbering should not be restarted at logical page delimiters.
199 Specify the characters used in separating the line number and the corresponding
203 setting is a single tab character.
205 Specify the initial value used to number logical page lines; see also the
213 Specify the number of characters to be occupied by the line number;
216 is insufficient to hold the line number, it will be truncated to its
218 least significant digits.
236 utility first appeared in