[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    pg(1) manual page Table of Contents

Name

pg - files perusal filter for CRTs

Synopsis

pg [ -number ] [ -p string ] [ -cefnrs ] [ +linenumber ] [ +/pattern/ ] [ filename ... ]

Availability

SUNWcsu

Description

The pg command is a filter that allows the examination of filenames one screenful at a time on a CRT . If the user types a RETURN , another page is displayed; other possibilities are listed 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.

To determine terminal attributes, pg scans the terminfo(4) data base for the terminal type specified by the environment variable TERM . If TERM is not defined, the terminal type dumb is assumed.

Options

-number
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
pg uses string 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 ‘‘:’’.
-c
Home the cursor and clear the screen before displaying each page. This option is ignored if clear_screen is not defined for this terminal type in the terminfo(4) data base.
-e
pg does not pause at the end of each file.
-f
Normally, pg splits lines longer than the screen width, but some sequences of characters in the text being displayed (for instance, escape sequences for underlining) generate undesirable results. The -f option inhibits pg from splitting lines.
-n
Normally, commands must be terminated by a <newline> 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 prints an error message but does not exit.
-s
pg prints all messages and prompts in the standard output mode (usually inverse video).
+linenumber
Start up at linenumber.
+/pattern/
Start up at the first line containing the regular expression pattern.

Operands

The following operands are supported:
filename
A path name of a text file to be displayed. If no filename is given, or if it is -, the standard input is read.

Usage

Commands

The responses that may 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 in either pages or lines depending on the command. A signed address specifies a point relative to the current page or line, and an unsigned address 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)<newline> or <blank>
This causes one page to be displayed. The address is specified in pages.
(+1) l
With a relative address this causes pg 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) d or ^D
Simulates scrolling half a screen forward or backward.
if
Skip i screens of text.
iz
Same as <newline> except that i, if present, becomes the new default number of lines per screenful.

The following perusal commands take no address.