Previous | Table of Contents | Next |
DESCRIPTION
The external pg command is used to examine a file one screen at a time. It functions as an enhanced cat command or a stripped down view command, providing functionality somewhere in between. The pg paginator allows you to:
COMMAND FORMAT
Following is the general format of the pg command.
pg [ - ] [ -cefnrs ] [ -n ] [ -p prompt ] [ +line ] [ +/pattern/ ] \ file_list
Options
The following list describes the options and their arguments used to control how pg functions.
- | Forces pg to read from the standard input. |
-c | Home the cursor and clear the screen before displaying each screen. Each page is displayed on a clear screen instead of scrolling the lines. The TERM variable must be defined. The TERMinal type must have clear screen capabilities defined in the TERMCAP or TERMINFO database. |
-e | Don t prompt for a response at the end of each file. Normally pg prompts you at the end-of-file. |
-f | Inhibits line splitting. If a line is longer than the screen width, pg normally splits the line. For instance, if the line has many escape sequences to control terminal attributes, pg will split the line and it will appear incorrect. The -f option is useful when characters that don t appear on the display are embedded in the file. |
-n | Does not require a new-line character to process a command. Single-letter commands are interpreted and processed immediately. |
-r | Restrict shell escape from pg . An error message is displayed if an attempt is made to escape to the shell. |
-s | Turns on standout mode causing pg to display its prompts and messages in standout mode. Usually, this is reverse video. The TERMCAP or TERMINFO entry for the specified TERMinal defines what standout mode is on your terminal. |
- n | Specifies the number of lines pg uses for the screen window. If the terminal is defined to have a 24-line screen, the window is set to 23 lines. |
-p prompt | Changes the prompt displayed by pg to be prompt . Normally, a colon (:) is displayed. If %d is placed in the prompt string, the current page number is substituted. |
+ line | Begin displaying the file at line number line . |
+/ pattern / | Begin displaying the file at the first occurrence of pattern . Pattern may be a string or a regular expression. |
Arguments
The following describes the argument that may be passed to the pg command.
file_list | One or more files pg reads and displays on your terminal screen. pg prompts you between each file unless the -e option is used. |
FURTHER DISCUSSION
After each screen is displayed pg prompts you for a response. There are three basic types of responses:
The pg command needs to know the attributes for your terminal. It searches the TERMCAP or TERMINFO database for the terminal defined by the TERM variable. If TERM is not set, pg assumes you are on a dumb terminal.
COMMANDS
At the end of each screen pg prompts for a response. To continue you must enter one of the following commands at the prompt. The commands are separated into four categories:
Perusal Commands
These commands let you move around the current file ( line-by-line motion only) and peruse the data. An address may be placed before these commands except for the Redisplay (. or Ctrl-L) and Last Screen ($) commands.
The address affects pages or lines depending on the command. Using these commands you can move to an absolute address or a relative address. An absolute address is measured from the beginning of the file. A relative address is measured from your current position within the file.
Previous | Table of Contents | Next |