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.
73 lines
1.1 KiB
Groff
Executable File
73 lines
1.1 KiB
Groff
Executable File
.TH SSAM 1
|
|
.SH NAME
|
|
ssam \- stream interface to sam
|
|
.SH SYNOPSIS
|
|
.B ssam
|
|
[
|
|
.B -n
|
|
]
|
|
[
|
|
.B -e
|
|
.I script
|
|
]
|
|
[
|
|
.B -f
|
|
.I sfile
|
|
]
|
|
[
|
|
.I file ...
|
|
]
|
|
.SH DESCRIPTION
|
|
.I Ssam
|
|
copies the named
|
|
.I files
|
|
(standard input default) to the standard output, edited by a script of
|
|
.IR sam
|
|
commands (q.v.).
|
|
When the script starts, the entire input is selected.
|
|
The
|
|
.B -f
|
|
option causes the script to be taken from file
|
|
.IR sfile .
|
|
If there is a
|
|
.B -e
|
|
option and no
|
|
.BR -f ,
|
|
the flag
|
|
.B -e
|
|
may be omitted.
|
|
The
|
|
.B -n
|
|
option suppresses the default output.
|
|
.ne 4
|
|
.SH EXAMPLES
|
|
.TP
|
|
.B ssam -n ,10p file
|
|
Print first 10 lines of file.
|
|
.TP
|
|
.B ssam 'y/[a-zA-Z]+/ c/\en/' *.ms
|
|
Print one word per line.
|
|
.TP
|
|
.B ssam 's/\en\en+/\en/g'
|
|
Delete empty lines from standard input.
|
|
.TP
|
|
.B ssam 's/UNIX/& system/g'
|
|
Replace every instance of
|
|
.L UNIX
|
|
by
|
|
.LR "UNIX system" .
|
|
.TP
|
|
.B ssam 'y/[a-zA-Z]+/ c/\en/' | grep . | sort | uniq -c
|
|
Count frequency of words read from standard input.
|
|
.SH SOURCE
|
|
.B \*9/bin/ssam
|
|
.SH SEE ALSO
|
|
.IR sed (1),
|
|
.MR sam 1 ,
|
|
.MR regexp 7
|
|
.PP
|
|
Rob Pike,
|
|
``The text editor sam''.
|
|
.SH BUGS
|
|
Ssam consumes all of standard input before running the script.
|