1
0
mirror of git://git.suckless.org/sbase synced 2025-03-19 01:26:54 +00:00

sed.1: add some missing info

There are some features that are coded already, might as well document them.
This commit is contained in:
Andrea Calligaris 2024-12-06 10:37:37 +01:00 committed by Roberto E. Vargas Caballero
parent 20c27b1ad0
commit 782afdf8c6

22
sed.1
View File

@ -50,16 +50,32 @@ Append the commands from
to the list of editing commands. to the list of editing commands.
.El .El
.Sh EXTENDED DESCRIPTION .Sh EXTENDED DESCRIPTION
Editing commands take the form Editing commands take the form:
.Pp .Pp
[address[,address]]function [address[,address]]function
.Pp
Commands can be separated by ';' or by a new line.
.Pp
Multiple functions for the specified address (or address-range) can be enclosed
in blocks with '{' and '}':
.Pp
[address[,address]] { function ; function }
.Pp
.Ss Addresses .Ss Addresses
Addresses are either blank, a positive decimal integer denoting a line Addresses are either blank, a positive decimal integer denoting a line
number, the character '$' denoting the last line of input, or a regular number, the character '$' denoting the last line of input, or a regular
expression. expression (in the format
.No / Ns
.Ar regexp Ns /).
A command with no addresses matches every line, one address matches A command with no addresses matches every line, one address matches
individual lines, and two addresses matches a range of lines from the individual lines, and two addresses matches a range of lines from the
first to the second address inclusive. first to the second address inclusive.
.Pp
The character '!' may be appended after the addresses,
in which case the function is executed only if the addresses
.Em don't
match.
.Pp
.Ss Functions .Ss Functions
.Bl -tag -width Ds .Bl -tag -width Ds
.It Ar a Op Ar text .It Ar a Op Ar text
@ -152,6 +168,8 @@ Replace each occurrence of a character from set 1 with the corresponding
character from set 2. character from set 2.
.It Ar :label .It Ar :label
Create a label for b and t commands. Create a label for b and t commands.
.It Ar #comment
The comment extends until the next newline.
.It Ar = .It Ar =
Write current input line number to output. Write current input line number to output.
.El .El