.TH scat "" "" Command
.PC "Print text files one screenful at a time"
\fBscat [ [\fIoption ...\^\fB] [\fIfile\fB ... ] ] ... \fR
.PP
.HS
.SH Options:
.IC \fB\-1\fR
Do not stop at EOF if exactly one file specified
.IC \fB\-b\fIn\fR
Begin output at line \fIn\fR
.IC \fB\-c\fR
Mark control characters (overrides \fB\-t\fR)
.IC \fB\-cs\fR
Like \fB\-c\fR, but map space to underscore
`_', and prefix underscore with `\e'
.IC \fB\-ct\fR
Like \fB\-c\fR, but map tabs to spaces
.IC \fB\-in\fR
Skip \fIn\fR columns on output
.IC \fB\-ln\fR
Set screen length to \fIn\fR lines
.IC \fB\-n\fR
Number input lines
.IC \fB\-r\fR
Remote; no paging
.IC \fB\-s\fR
Squash empty lines
.IC \fB\-S\fIn\fR
Seek \fIn\fR bytes into input before processing
.IC \fB\-t\fR
Truncate lines to line length (default, wraparound)
.IC \fB\-w\fIn\fR
Set screen width to \fIn\fR columns
.IC \fB\-x\fR
Expand tabs
.SH Commands:
.IC \fB<return>\fR
Next page
.IC \fB<space>\fR
Next line
.IC \fB/\fR
Next half page
.IC \fBf\fR
Print file names and line number
.IC \fBn\fR
Next file
.IC \fBq\fR
Quit
.HE
.B scat
prints each
.I file
on the standard output,
one screenful (24 lines) at a time if the output is a screen.
.B scat
reads and prints the standard input if no
.I file
is named.
.PP
The text is processed to allow convenient viewing on a screen;
the options described below select the nature of the processing.
Options begin with `\-' and may be interspersed with file names.
.PP
.B scat
scans two argument lists.
The first is in the environmental
.BR SCAT .
It should consist of arguments separated by white space
(space, tab, or newline characters),
with no quoting or shell metacharacters.
This string is a useful place to set terminal-dependent parameters
(such as page width and length) and to place invocation lists
(see below).
The second argument list is supplied on the command line.
.PP
.B scat
recognizes the following options:
.RS
.IP "\fB\-1\fR"
Do not stop at EOF if exactly one file was specified on the command line.
.IP "\fB\-b\fIn\fR"
Begin output at input line
.I n.
.IP \fB\-c\fR
Represent all control characters unambiguously.
With this option,
.B scat
prints control characters in the range 0-037 as a character in the
range 0100-0137 prefixed by a carat `^';
for example, SOH appears as ``^A'' and DEL as ``^?''
It prints
mark-parity characters (in the range of 0200-0377) with `~'; for example,
mark-parity `A' and SOH appear as ``~A'' and ``~^A'',
respectively.
It also prefixes
the characters `^', `~', and `\e'
with a `\e'.
This option overrides the option
.BR \-t .
.IP \fB\-cs\fR
Like
.B \-c,
but map space `\ ' to underscore `_'
and prefix underscore `_' with `\e'.
.IP \fB\-ct\fR
Like
.B \-c,
but map tabs to spaces, not ``^I''.
.IP "\fB\-i\fIn\fR"
Shift the display window right
.I n
columns into the text field.
This is useful for viewing long lines.
.IP "\fB\-l\fIn\fR"
Set the display window length to
.I n
lines.
The default is 24 normally, 34 for the Tek 4012.
.IP \fB\-n\fR
Number input lines; wrapped lines are not numbered.
.IP \fB\-r\fR
Remote;
the output is not paged.
.IP \fB\-s\fR
Skip empty lines.
.IP "\fB\-S\fIn\fR"
Seek
.I n
bytes into input before processing.
.IP \fB\-t\fR
Truncate long lines.
Normally,
.B scat
wraps each long line, with the
interrupted portion delimited by a `\e'.
.IP "\fB\-w\fIn\fR"
Set the display window width to
.I n
columns.
The default is 80 normally, 72 for the Tek 4012.
.IP \fB\-x\fR
Expand tabs.
.IP "\fB\-. \fIsuffix\fR"
Invoke options by file-name suffix.
If a file name ends with
.IR .suffix ,
then
.B scat
scans the argument sublist starting immediately after the invocation flag.
New options will apply to the invoking file only.
A sublist is terminated by the end of the argument list,
by a file name, by the ``\-\-'' flag, or by another ``\-.''
(invocation lists do not nest).
.IP \fB\-\-\fR
Terminate a sublist (see previous option).
.RE
.PP
Numbers may begin with
.B 0
to indicate octal,
and may end in
.B b
or
.B k
to be scaled by 512 or 1,024, respectively.
.PP
If the output is being paged,
.B scat
waits for a user response,
which may be one of the following:
.DS
.ta 0.75i
\fBnewline\fP	Display next page
\fB/\fP	Display next half-page
\fBspace\fP	Display next line
\fBf\fP	Print current file name and line number
\fBn\fP	\fBscat\fP next file
\fBq\fP	Quit
.DE
.SH Example
The following shows how to use the environment argument list,
invocation lists, and sublists:
.DM
SCAT="\-l24 \-.c \-n \-.s \-b5"
export SCAT
scat *.c *.s
.DE
.PP
After processing the
.B SCAT
argument list,
.B scat
processes the command line argument list ``\fB*.c *.s\fR''
with the page length at 24 lines.
If a file is a C source (``\fB*.c\fP'')
the invoke option in the
.B SCAT
argument list numbers the output lines.
If a file is an assembly source (``\fB*.s\fP'')
.B scat
skips the first four lines.
.SH "See Also"
.Xr "cat," cat
.Xr "commands," commands
.Xr "pr" pr
