Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ nl(1) — DG/UX 4.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought



                                                                    nl(1)



        _________________________________________________________________
        nl                                                        Command
        line numbering filter
        _________________________________________________________________


        SYNTAX

        nl [-htype] [-btype] [-ftype] [-vstart#] [-iincr] [-p] [-lnum]
        [-ssep] [-wwidth] [-nformat] [-ddelim] file


        DESCRIPTION

        Nl 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 (e.g., no
        numbering of header and footer lines while numbering blank lines
        only in the body).

        The start of logical page sections are signaled by input lines
        containing only the following delimiter character(s):

                  Line contents  Start of

                  \:\:\:         Header

                  \:\:           Body

                  \:             Footer

        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 only one optional filename.  The options are:

        -btype    Specifies which logical page body lines are to be
                  numbered.  Recognized types and their meaning are:

                  a    number all lines
                  t    number lines with printable text only
                  n    no line numbering
                  pstringnumber only lines that contain the regular expression



        DG/UX 4.00                                                 Page 1
               Licensed material--property of copyright holder(s)





                                                                    nl(1)



                       specified in string.

                  Default type for logical page body is t (text lines
                  numbered).

        -htype    Same as -btype except for header.  Default type for
                  logical page header is n (no lines numbered).

        -ftype    Same as -btype, but default for logical page footer is
                  n (no lines numbered).

        -p        Do not restart numbering at logical page delimiters.

        -vstart#  Start# is the initial value used to number logical page
                  lines.  Default is 1.

        -iincr    Incr is the increment value used to number logical page
                  lines.  Default is 1.

        -ssep     Sep is the character(s) used in separating the line
                  number and the corresponding text line.  Default sep is
                  a tab.

        -wwidth   Width is the number of characters to be used for the
                  line number.  Default width is 6.

        -nformat  Format is the line numbering format.  Recognized values
                  are:

                  ln   left justified, leading zeroes suppressed;
                  rn   right justified, leading zeroes supressed;
                  rz   right justified, leading zeroes kept.

                  Default format is rn (right justified).

        -lnum     Num is the number of blank lines to be considered as
                  one line.  For example, -l2 numbers only the second
                  adjacent blank (if the appropriate -ha, -ba, and/or -fa
                  option is set).  Default is 1.

        -dxx      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.



        _________________________________________________________________



        DG/UX 4.00                                                 Page 2
               Licensed material--property of copyright holder(s)





                                                                    nl(1)



        EXAMPLES

        $ cat oldfile

        Cari Goldsmith:
         Mill Valley, CA
        Bella Anderson:
         Los Altos, CA
        Susan Walton:
         Cleveland, OH
        $ nl -bp: oldfile >newfile
        $ cat newfile

             1Cari Goldsmith:
                Mill Valley, CA
             2Bella Anderson:
                Los Altos, CA
             3Susan Walton:
                Cleveland, OH
        $

        This example inserts line numbers on all lines in the input file
        that contain a colon.
        _________________________________________________________________


        SEE ALSO

        pr(1).

























        DG/UX 4.00                                                 Page 3
               Licensed material--property of copyright holder(s)



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