


      PPPPGGGG((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      PPPPGGGG((((1111))))



      NNNNAAAAMMMMEEEE
           pg - file perusal filter for soft-copy terminals

      SSSSYYYYNNNNTTTTAAAAXXXX
           ppppgggg [[[[----_n_u_m_b_e_r]]]] [[[[----pppp _s_t_r_i_n_g]]]] [[[[----cccceeeeffffnnnnssss]]]] [[[[++++_l_i_n_e_n_u_m_b_e_r]]]] [[[[++++////_p_a_t_t_e_r_n////]]]]
           [[[[files............]]]]

      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
           The _p_g command is a filter which allows the examination of
           _f_i_l_e_s one screenful at a time on a soft-copy terminal.  (The
           file name - and/or NULL arguments indicate that _p_g should
           read from the standard input.) Each screenful is followed by
           a prompt.  If the user types a carriage return, another page
           is displayed; other possibilities are enumerated below.

           This command is different from previous paginators in that
           it allows you to back up and review something that has
           already passed.  The method for doing this is explained
           below.

           In order to determine terminal attributes, _p_g scans the
           _t_e_r_m_i_n_f_o(4) data base for the terminal type specified by the
           environment variable TTTTEEEERRRRMMMM.  If TTTTEEEERRRRMMMM is not defined, the
           terminal type dddduuuummmmbbbb is assumed.

           The command line options are:

           -_n_u_m_b_e_r
                An integer specifying the size (in lines) of the window
                that _p_g is to use instead of the default.  (On a
                terminal containing 24 lines, the default window size
                is 23).

           ----pppp _s_t_r_i_n_g
                Causes _p_g to use _s_t_r_i_n_g as the prompt.  If the prompt
                string contains a ``%d'', the first occurrence of
                ``%d'' in the prompt will be replaced by the current
                page number when the prompt is issued.  The default
                prompt string is ``::::''.

           ----cccc   Home the cursor and clear the screen before displaying
                each page.  This option is ignored if cccclllleeeeaaaarrrr____ssssccccrrrreeeeeeeennnn is
                not defined for this terminal type in the _t_e_r_m_i_n_f_o(4)
                data base.

           ----eeee   Causes _p_g _n_o_t to pause at the end of each file.

           ----ffff   Normally, _p_g splits lines longer than the screen width,
                but some sequences of characters in the text being
                displayed (e.g., escape sequences for underlining)
                generate undesirable results.  The -_f option inhibits
                _p_g from splitting lines.



      Page 1                                                   (9010-E)






      PPPPGGGG((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      PPPPGGGG((((1111))))



           ----nnnn   Normally, commands must be terminated by a <_n_e_w_l_i_n_e>
                character.  This option causes an automatic end of
                command as soon as a command letter is entered.

           ----ssss   Causes _p_g to print all messages and prompts in standout
                mode (usually inverse video).

           ++++_l_i_n_e_n_u_m_b_e_r
                Start up at _l_i_n_e_n_u_m_b_e_r.

           ++++////_p_a_t_t_e_r_n////
                Start up at the first line containing the regular
                expression pattern.

           The responses that may be typed when _p_g pauses can be
           divided into three categories: those causing further
           perusal, those that search, and those that modify the
           perusal environment.

           Commands which cause further perusal normally take a
           preceding _a_d_d_r_e_s_s, an optionally signed number indicating
           the point from which further text should be displayed.  This
           _a_d_d_r_e_s_s is interpreted in either pages or lines depending on
           the command.  A signed _a_d_d_r_e_s_s specifies a point relative to
           the current page or line, and an unsigned _a_d_d_r_e_s_s specifies
           an address relative to the beginning of the file.  Each
           command has a default address that is used if none is
           provided.

           The perusal commands and their defaults are as follows:

           (+1)<_n_e_w_l_i_n_e> or <_b_l_a_n_k>
                This causes one page to be displayed.  The address is
                specified in pages.

           (+1) llll
                With a relative address this causes _p_g to simulate
                scrolling the screen, forward or backward, the number
                of lines specified.  With an absolute address this
                command prints a screenful beginning at the specified
                line.

           (+1) dddd or ^^^^DDDD
                Simulates scrolling half a screen forward or backward.

           The following perusal commands take no _a_d_d_r_e_s_s.

           .... or ^^^^LLLL
                Typing a single period causes the current page of text
                to be redisplayed.

           $$$$    Displays the last windowful in the file.  Use with



      Page 2                                                   (9010-E)






      PPPPGGGG((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      PPPPGGGG((((1111))))



                caution when the input is a pipe.

           The following commands are available for searching for text
           patterns in the text.  The regular expressions described in
           _e_d(1) are available.  They must always be terminated by a
           <_n_e_w_l_i_n_e>, even if the -_n option is specified.

           _i////_p_a_t_t_e_r_n////
                Search forward for the _ith (default _i=1) occurrence of
                _p_a_t_t_e_r_n.  Searching begins immediately after the
                current page and continues to the end of the current
                file, without wrap-around.

           _i^^^^_p_a_t_t_e_r_n^^^^
           _i????_p_a_t_t_e_r_n????
                Search backwards for the _ith (default _i=1) occurrence
                of _p_a_t_t_e_r_n.  Searching begins immediately before the
                current page and continues to the beginning of the
                current file, without wrap-around.  The ^ notation is
                useful for Adds 100 terminals which will not properly
                handle the ?.

           After searching, _p_g will normally display the line found at
           the top of the screen.  This can be modified by appending mmmm
           or bbbb to the search command to leave the line found in the
           middle or at the bottom of the window from now on.  The
           suffix tttt can be used to restore the original situation.

           The user of _p_g can modify the environment of perusal with
           the following commands:

           _innnn   Begin perusing the _ith next file in the command line.
                The _i is an unsigned number, default value is 1.

           _ipppp   Begin perusing the _ith previous file in the command
                line.  _i is an unsigned number, default is 1.

           _iwwww   Display another window of text.  If _i is present, set
                the window size to _i.

           ssss _f_i_l_e_n_a_m_e
                Save the input in the named file.  Only the current
                file being perused is saved.  The white space between
                the ssss and _f_i_l_e_n_a_m_e is optional.  This command must
                always be terminated by a <_n_e_w_l_i_n_e>, even if the -_n
                option is specified.

           hhhh    Help by displaying an abbreviated summary of available
                commands.

           qqqq or QQQQ
                Quit _p_g.



      Page 3                                                   (9010-E)






      PPPPGGGG((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      PPPPGGGG((((1111))))



           !!!!_c_o_m_m_a_n_d
                _C_o_m_m_a_n_d is passed to the shell, whose name is taken
                from the SSSSHHHHEEEELLLLLLLL environment variable.  If this is not
                available, the default shell is used.  This command
                must always be terminated by a <_n_e_w_l_i_n_e>, even if the
                -_n option is specified.

           At any time when output is being sent to the terminal, the
           user can hit the quit key (normally control-\) or the
           interrupt (break) key.  This causes _p_g to stop sending
           output, and display the prompt.  The user may then enter one
           of the above commands in the normal manner.  Unfortunately,
           some output is lost when this is done, due to the fact that
           any characters waiting in the terminal's output queue are
           flushed when the quit signal occurs.

           If the standard output is not a terminal, then _p_g acts just
           like _c_a_t(1), except that a header is printed before each
           file (if there is more than one).

      EEEEXXXXAAAAMMMMPPPPLLLLEEEE
           A sample usage of _p_g in reading system news would be

                               news | pg -p "(Page %d):"

      NNNNOOOOTTTTEEEESSSS
           While waiting for terminal input, _p_g responds to BBBBRRRREEEEAAAAKKKK, DDDDEEEELLLL,
           and ^^^^ by terminating execution.  Between prompts, however,
           these signals interrupt _p_g's current task and place the user
           in prompt mode.  These should be used with caution when
           input is being read from a pipe, since an interrupt is
           likely to terminate the other commands in the pipeline.

           Users of Berkeley's _m_o_r_e will find that the z and f commands
           are available, and that the terminal /, ^, or ? may be
           omitted from the searching commands.

      FFFFIIIILLLLEEEESSSS
           /usr/lib/terminfo/*
                Terminal information data base

           /tmp/pg*
                Temporary file when input is from a pipe

      SSSSEEEEEEEE AAAALLLLSSSSOOOO
           crypt(1), ed(1), grep(1), terminfo(4).

      BBBBUUUUGGGGSSSS
           If terminal tabs are not set every eight positions,
           undesirable results may occur.

           When using _p_g as a filter with another command that changes



      Page 4                                                   (9010-E)






      PPPPGGGG((((1111))))                       ((((UUUUNNNNIIIIXXXX 5555....2222))))                      PPPPGGGG((((1111))))



           the terminal I/O options (e.g., _c_r_y_p_t(1)), terminal settings
           may not be restored correctly.





















































      Page 5                                                   (9010-E)



