nl - line numbering filter
/usr/bin/nl [-p] [-b [type]] [-d [delim]] [-f [type]] [-h [type]] [-i [incr]] [-l [num]] [-n [format]] [-s [sep]] [-w [width]] [-v [startnum]] [file]
/usr/xpg4/bin/nl [-p] [-b type] [-d delim] [-f type] [-h type] [-i incr] [-l num] [-n format] [-s sep] [-w width] [-v startnum] [file]
The nl utility reads lines from the named file, or the standard input if no file is named, and reproduces the lines on the standard output. Lines are numbered on the left in accordance with the command options in effect.
nl views the text it reads in terms of logical pages. Line numbering is reset at the start of each logical page. A logical page consists of a header, a body, and a footer section. Empty sections are valid. Different line numbering options are independently available for header, body, and footer. For example, -bt (the default) numbers non-blank lines in the body section and does not number any lines in the header and footer sections.
The start of logical page sections are signaled by input lines containing nothing but the following delimiter character(s):
|
Unless optioned otherwise, nl assumes the text being read is in a single logical page body.
Command options may appear in any order and may be intermingled with an optional file name. Only one file may be named. The specified default is used when the option is not entered on the command line. /usr/xpg4/bin/nl options require option arguments. A SPACE character may separate options from option arguments. /usr/bin/nl options may have option arguments. If option-arguments of /usr/bin/nl options are not specified, these options result in the default. The supported options are:
-btype
a
t
n
pexp
Default type for logical page body is t (text lines numbered).
-ftype
-ddelim
-htype
-iincr
-lnum
-nformat
ln
rn
rz
Default format is rn (right justified).
-p
-ssep
-vstartnum
-wwidth
The following operand is supported:
file
Example 1 An example of the nl command
The command:
example% nl -v10 -i10 -d!+ filename1
will cause the first line of the page body to be numbered 10, the second line of the page body to be numbered 20, the third 30, and so forth. The logical page delimiters are !+.
See environ(5) for descriptions of the following environment variables that affect the execution of nl: LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES, and NLSPATH.
The following exit values are returned:
0
>0
/usr/lib/locale/locale/LC_COLLATE/CollTable
/usr/lib/locale/locale/LC_COLLATE/coll.so
See attributes(5) for descriptions of the following attributes:
|
|
pr(1), attributes(5), environ(5), regex(5), regexp(5), standards(5)
Internationalized Regular Expressions are used in the POSIX and "C" locales. In other locales, Internationalized Regular Expressions are used if the following two conditions are met:
Otherwise, Simple Regular Expressions are used.
Internationalized Regular Expressions are explained on regex(5). Simple Regular Expressions are explained on regexp(5).
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |