Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ nl(1) — SunOS 4.0.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

pr(1V)

NL(1)  —  USER COMMANDS

NAME

nl − line numbering filter

SYNOPSIS

nl [ −p ] [ −h type ] [ −b type ] [ −ftype ] [ −v start ] [ −i incr ] [ −l num ] [ −s sep ] [ −w width ]

[ −n fmt ] [ −d delim ] filename

AVAILABILITY

This command is available with the System V software installation option.  Refer to Installing the SunOS for information on how to install optional software. 

DESCRIPTION

nl reads lines from filename (or the standard input), numbers them according to the options in effect, and sends its output to the standard output. 

nl views the text it reads in terms of logical pages.  Line numbering is normally reset at the start of each page.  A logical page is composed of header, body and footer sections.  The start of each page section is signaled by input lines containing section delimiters only:

Start of file
\:\:\:
header
\:\:
body
\:
footer

Empty sections are valid.  Different line-numbering options are available within each section.  The default scheme is no numbering for headers and footers. 

OPTIONS

−p Do not restart numbering at logical page delimiters. 

−b type Specify which logical page body lines are to be numbered.  type is one of:

a number all lines

t number lines with printable text only (the default)

n , no line numbering

p rexp number only lines that contain the regular expression rexp

−h type Same as −b type except for the header.  The default type for the logical page header is n (no lines numbered). 

−ftype Same as −b type except for the footer.  The default for logical page footer is n (no lines numbered). 

−v start start is the initial value used to number logical page lines.  The default is 1. 

−i incr incr is the increment by which to number logical page lines.  The default is 1. 

−s sep sep is the character(s) used to separate the line number from the corresponding text line.  The default is a TAB. 

−w width width is the number of characters to be used for the line-number field.  The default is 6. 

−n fmt fmt is the line numbering format.  Recognized values are:

rn right justified, leading zeroes suppressed (the default)

ln left justified, leading zeroes suppressed

rz right justified, leading zeroes kept

−l num num is the number of blank lines to be considered as one.  For example, −l2 results in only the second adjacent blank being numbered (if the appropriate −ha, −ba, and/or −fa option is set).  The default is 1. 

−d xx The delimiter characters specifying the start of a logical page section may be changed from the default characters (\:) to two user-specified characters.  If only one character is entered, the second character remains the default character (:).  No space should appear between the −d and the delimiter characters.  To enter a backslash, use two backslashes. 

EXAMPLE

The command:

nl −v10 −i10 −d!+ filename1

will number filename1 starting at line number 10 with an increment of ten.  The logical page delimiters are !+. 

SEE ALSO

pr(1V)

Sun Release 4.0  —  Last change: 21 December 1987

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026