pg.1 (2010 09)

p
pg(1) pg(1)
NAME
pg - file perusal filter for soft-copy terminals
SYNOPSIS
pg [-number ][-pstring ][
-cefnrs ][+linenumber ][+/ pattern ][file ... ]
Remarks
pg and more are both used in similar situations (see more(1)). Text highlighting features supported by
more are not available from pg. However,
pg has some useful features not provided by more.
DESCRIPTION
pg is a text file filter that allows the examination of files one screenful at a time on a soft-copy terminal.
If
- is used as a file argument, or
pg detects NULL arguments in the comand line, the standard input is
used. Each screenful is followed by a prompt. To display a new page, press Return. Other possibilities
are enumerated below.
This command is different from other paginators such as
more in that it can back up for reviewing some-
thing that has already passed. The method for doing this is explained below.
In order to determine terminal attributes,
pg
scans the terminfo data base for the terminal type
specified by the environment variable
TERM (see terminfo (4)). If TERM is not defined, terminal type
dumb is assumed.
Options
pg recognizes the following command line options:
-number number is an integer specifying the size (in lines) of the window that pg is to use
instead of the default (on a terminal containing 24 lines, the default window size is
23).
-p string Causes pg to use string as the prompt. If the prompt string contains a
%d, the first
occurrence of
%d in the prompt is replaced by the current page number when the
prompt is issued. The default prompt string is a colon (:).
-c Home the cursor and clear the screen before displaying each page. This option is
ignored if clear_screen is not defined in the terminfo data base for this ter-
minal type.
-e Causes pg to not pause at the end of each file.
-f Normally, pg splits lines longer than the screen width, but some sequences of char-
acters in the text being displayed (such as escape sequences for underlining) gen-
erate undesirable results. The -f option inhibits pg from splitting lines.
-n Normally, commands must be terminated by a new-line character. This option
causes an automatic end-of-command as soon as a command letter is entered.
-r Restricted mode. The shell escape is disallowed. pg will print an error message
but does not exit.
-s Causes pg to print all messages and prompts in standout mode (usually inverse
video).
+linenumber Start display at linenumber .
+/pattern / Start up at the first line containing text that matches the regular expression pat-
tern .
pg looks in the environment variable PG to preset any flags desired. For example, if you prefer to view
files using the -c mode of operation, the POSIX-shell command sequence PG=’-c’ ; export PG or
the C-shell command setenv PG -c causes all invocations of pg, including invocations by programs
such as man and msgs, to use this mode. The command sequence to set up the PG environment vari-
able is normally placed in the user .profile or .cshrc file. No form of quoting is provided, so the
string and pattern arguments are limited to single word.
The responses that can be typed when
pg pauses can be divided into three categories: those causing
further perusal, those that search, and those that modify the perusal environment.
Commands that cause further perusal normally take a preceding address , an optionally signed number
indicating the point from which further text should be displayed. This address is interpreted either in
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (4 pages)