groff 1.23.0 added .MR to its -man macro package. The NEWS file states
that the inclusion of the macro "was prompted by its introduction to
Plan 9 from User Space's troff in August 2020." From d32deab it seems
that the name for Plan 9 from User Space's implementation was suggested
by groff maintainer G. Brandon Robinson.
Not sure if the intention was to make these definitions compatible, but
it would be nice if they were.
Currently, Plan 9 from User Space's .MR expects its second argument to
be parenthesized. groff's .MR does not. This results in extra
parentheses appearing in manual references when viewing Plan 9 from User
Space's manual pages on a system using groff.
109 lines
1.6 KiB
Groff
109 lines
1.6 KiB
Groff
.TH CAT 1
|
|
.SH NAME
|
|
cat, read, nobs \- catenate files
|
|
.SH SYNOPSIS
|
|
.B cat
|
|
[
|
|
.I file ...
|
|
]
|
|
.br
|
|
.B read
|
|
[
|
|
.B -m
|
|
] [
|
|
.B -n
|
|
.I nline
|
|
] [
|
|
.I file ...
|
|
]
|
|
.br
|
|
.B nobs
|
|
[
|
|
.I file ...
|
|
]
|
|
.SH DESCRIPTION
|
|
.I Cat
|
|
reads each
|
|
.I file
|
|
in sequence and writes it on the standard output.
|
|
Thus
|
|
.IP
|
|
.L
|
|
cat file
|
|
.LP
|
|
prints a file and
|
|
.IP
|
|
.L
|
|
cat file1 file2 >file3
|
|
.LP
|
|
concatenates the first two files and places the result
|
|
on the third.
|
|
.PP
|
|
If no
|
|
.I file
|
|
is given,
|
|
.I cat
|
|
reads from the standard input.
|
|
Output is buffered in blocks matching the input.
|
|
.PP
|
|
.I Read
|
|
copies to standard output exactly one line from the named
|
|
.IR file ,
|
|
default standard input.
|
|
It is useful in interactive
|
|
.MR rc 1
|
|
scripts.
|
|
.PP
|
|
The
|
|
.B -m
|
|
flag causes it to continue reading and writing multiple lines until end of file;
|
|
.B -n
|
|
causes it to read no more than
|
|
.I nline
|
|
lines.
|
|
.PP
|
|
.I Read
|
|
always executes a single
|
|
.B write
|
|
for each line of input, which can be helpful when
|
|
preparing input to programs that expect line-at-a-time data.
|
|
It never reads any more data from the input than it prints to the output.
|
|
.PP
|
|
.I Nobs
|
|
copies the named files to
|
|
standard output except that it removes all backspace
|
|
characters and the characters that precede them.
|
|
It is useful to use as
|
|
.B $PAGER
|
|
with the Unix version of
|
|
.MR man 1
|
|
when run inside a
|
|
.I win
|
|
(see
|
|
.MR acme 1 )
|
|
window.
|
|
.SH SOURCE
|
|
.B \*9/src/cmd/cat.c
|
|
.br
|
|
.B \*9/src/cmd/read.c
|
|
.br
|
|
.B \*9/bin/nobs
|
|
.SH SEE ALSO
|
|
.MR cp 1
|
|
.SH DIAGNOSTICS
|
|
.I Read
|
|
exits with status
|
|
.B eof
|
|
on end of file or, in the
|
|
.B -n
|
|
case, if it doesn't read
|
|
.I nlines
|
|
lines.
|
|
.SH BUGS
|
|
Beware of
|
|
.L "cat a b >a"
|
|
and
|
|
.LR "cat a b >b" ,
|
|
which
|
|
destroy input files before reading them.
|