Changeset 3613 for trunk/src/sed/doc/sed.x
- Timestamp:
- Sep 19, 2024, 2:34:43 AM (10 months ago)
- Location:
- trunk/src/sed
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sed
-
Property svn:mergeinfo
set to
/vendor/sed/current merged eligible
-
Property svn:mergeinfo
set to
-
trunk/src/sed/doc/sed.x
r599 r3613 1 .SH NAME 2 sed \- a Stream EDitor3 .SH SYNOPSIS 1 [NAME] 2 sed \- stream editor for filtering and transforming text 3 [SYNOPSIS] 4 4 .nf 5 5 sed [-V] [--version] [--help] [-n] [--quiet] [--silent] 6 6 [-l N] [--line-length=N] [-u] [--unbuffered] 7 [- r] [--regexp-extended]7 [-E] [-r] [--regexp-extended] 8 8 [-e script] [--expression=script] 9 9 [-f script-file] [--file=script-file] … … 43 43 .RI # comment 44 44 The comment extends until the next newline (or the end of a 45 .B -e45 .B \-e 46 46 script fragment). 47 47 .TP … … 68 68 which has each embedded newline preceded by a backslash. 69 69 .TP 70 q 70 q [\fIexit-code\fR] 71 71 Immediately quit the \*(sd script without processing 72 any more input, 73 except that if auto-print is not disabled 74 the current pattern space will be printed.75 .TP 76 Q 72 any more input, except that if auto-print is not disabled 73 the current pattern space will be printed. The exit code 74 argument is a GNU extension. 75 .TP 76 Q [\fIexit-code\fR] 77 77 Immediately quit the \*(sd script without processing 78 any more input. 78 any more input. This is a GNU extension. 79 79 .TP 80 80 .RI r\ filename … … 85 85 Append a line read from 86 86 .IR filename . 87 Each invocation of the command reads a line from the file. 88 This is a GNU extension. 87 89 .SS 88 90 Commands which accept address ranges … … 98 100 is omitted, branch to end of script. 99 101 .TP 100 .RI t\ label101 If a s/// has done a successful substitution since the102 last input line was read and since the last t or T103 command, then branch to104 .IR label ;105 if106 .I label107 is omitted, branch to end of script.108 .TP109 .RI T\ label110 If no s/// has done a successful substitution since the111 last input line was read and since the last t or T112 command, then branch to113 .IR label ;114 if115 .I label116 is omitted, branch to end of script.117 .TP118 102 c \e 119 103 .TP … … 128 112 .TP 129 113 D 130 Delete up to the first embedded newline in the pattern space. 131 Start next cycle, but skip reading from the input 132 if there is still data in the pattern space. 114 If pattern space contains no newline, start a normal new cycle as if 115 the d command was issued. Otherwise, delete text in the pattern 116 space up to the first newline, and restart cycle with the resultant 117 pattern space, without reading a new line of input. 133 118 .TP 134 119 h H … … 138 123 Copy/append hold space to pattern space. 139 124 .TP 140 x141 Exchange the contents of the hold and pattern spaces.142 .TP143 125 l 144 126 List out the current line in a ``visually unambiguous'' form. 127 .TP 128 .RI l\ width 129 List out the current line in a ``visually unambiguous'' form, 130 breaking it at 131 .I width 132 characters. This is a GNU extension. 145 133 .TP 146 134 n N … … 169 157 .IR regexp . 170 158 .TP 159 .RI t\ label 160 If a s/// has done a successful substitution since the 161 last input line was read and since the last t or T 162 command, then branch to 163 .IR label ; 164 if 165 .I label 166 is omitted, branch to end of script. 167 .TP 168 .RI T\ label 169 If no s/// has done a successful substitution since the 170 last input line was read and since the last t or T 171 command, then branch to 172 .IR label ; 173 if 174 .I label 175 is omitted, branch to end of script. This is a GNU 176 extension. 177 .TP 171 178 .RI w\ filename 172 179 Write the current pattern space to … … 176 183 Write the first line of the current pattern space to 177 184 .IR filename . 185 This is a GNU extension. 186 .TP 187 x 188 Exchange the contents of the hold and pattern spaces. 178 189 .TP 179 190 .RI y/ source / dest / … … 223 234 .I number 224 235 Match only the specified line 225 .IR number . 236 .IR number 237 (which increments cumulatively across files, unless the 238 .B \-s 239 option is specified on the command line). 226 240 .TP 227 241 .IR first ~ step … … 230 244 line starting with line 231 245 .IR first . 232 For example, ``sed -n 1~2p'' will print all the odd-numbered lines in246 For example, ``sed \-n 1~2p'' will print all the odd-numbered lines in 233 247 the input stream, and the address 2~5 will match every fifth line, 234 starting with the second. (This is an extension.) 248 starting with the second. 249 .I first 250 can be zero; in this case, \*(sd operates as if it were equal to 251 .IR step . 252 (This is an extension.) 235 253 .TP 236 254 $ … … 240 258 Match lines matching the regular expression 241 259 .IR regexp . 260 Matching is performed on the current pattern space, which 261 can be modified with commands such as ``s///''. 242 262 .TP 243 263 .BI \fR\e\fPc regexp c … … 263 283 .RI 1, addr2 264 284 form will still be at the beginning of its range. 285 This works only when 286 .I addr2 287 is a regular expression. 265 288 .TP 266 289 .IR addr1 ,+ N … … 292 315 .BR \et , 293 316 and other sequences. 317 The \fI-E\fP option switches to using extended regular expressions instead; 318 it has been supported for years by GNU sed, and is now 319 included in POSIX. 294 320 295 321 [SEE ALSO] … … 308 334 .PP 309 335 E-mail bug reports to 310 .BR bonzini@gnu.org . 311 Be sure to include the word ``sed'' somewhere in the ``Subject:'' field. 312 Also, please include the output of ``sed --version'' in the body 336 .BR bug-sed@gnu.org . 337 Also, please include the output of ``sed \-\-version'' in the body 313 338 of your report if at all possible.
Note:
See TracChangeset
for help on using the changeset viewer.