1 | This is Info file sed.info, produced by Makeinfo version 1.68 from the |
---|
2 | input file sed.texi. |
---|
3 | |
---|
4 | START-INFO-DIR-ENTRY |
---|
5 | * sed: (sed). Stream EDitor. |
---|
6 | END-INFO-DIR-ENTRY |
---|
7 | This file documents SED, a stream editor. |
---|
8 | |
---|
9 | Published by the Free Software Foundation, 59 Temple Place - Suite |
---|
10 | 330 Boston, MA 02111-1307, USA |
---|
11 | |
---|
12 | Copyright (C) 1998 Free Software Foundation, Inc. |
---|
13 | |
---|
14 | Permission is granted to make and distribute verbatim copies of this |
---|
15 | manual provided the copyright notice and this permission notice are |
---|
16 | preserved on all copies. |
---|
17 | |
---|
18 | Permission is granted to copy and distribute modified versions of |
---|
19 | this manual under the conditions for verbatim copying, provided that |
---|
20 | the entire resulting derived work is distributed under the terms of a |
---|
21 | permission notice identical to this one. |
---|
22 | |
---|
23 | Permission is granted to copy and distribute translations of this |
---|
24 | manual into another language, under the above conditions for modified |
---|
25 | versions, except that this permission notice may be stated in a |
---|
26 | translation approved by the Foundation. |
---|
27 | |
---|
28 | |
---|
29 | File: sed.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir) |
---|
30 | |
---|
31 | This document was produced for version 3.02 of GNU SED. |
---|
32 | |
---|
33 | * Menu: |
---|
34 | |
---|
35 | * Introduction:: Introduction |
---|
36 | * Invoking SED:: Invocation |
---|
37 | * sed Programs:: SED programs |
---|
38 | * Examples:: Some sample scripts |
---|
39 | * Limitations:: About the (non-)limitations on line length |
---|
40 | * Other Resources:: Other resources for learning about SED |
---|
41 | * Reporting Bugs:: Reporting bugs |
---|
42 | * Concept Index:: A menu with all the topics in this manual. |
---|
43 | * Command and Option Index:: A menu with all SED commands and |
---|
44 | command-line options. |
---|
45 | |
---|
46 | |
---|
47 | File: sed.info, Node: Introduction, Next: Invoking SED, Prev: Top, Up: Top |
---|
48 | |
---|
49 | Introduction |
---|
50 | ************ |
---|
51 | |
---|
52 | SED is a stream editor. A stream editor is used to perform basic |
---|
53 | text transformations on an input stream (a file or input from a |
---|
54 | pipeline). While in some ways similar to an editor which permits |
---|
55 | scripted edits (such as ED), SED works by making only one pass over the |
---|
56 | input(s), and is consequently more efficient. But it is SED's ability |
---|
57 | to filter text in a pipeline which particularly distinguishes it from |
---|
58 | other types of editors. |
---|
59 | |
---|
60 | |
---|
61 | File: sed.info, Node: Invoking SED, Next: sed Programs, Prev: Introduction, Up: Top |
---|
62 | |
---|
63 | Invocation |
---|
64 | ********** |
---|
65 | |
---|
66 | SED may be invoked with the following command-line options: |
---|
67 | |
---|
68 | `-V' |
---|
69 | `--version' |
---|
70 | Print out the version of SED that is being run and a copyright |
---|
71 | notice, then exit. |
---|
72 | |
---|
73 | `-h' |
---|
74 | `--help' |
---|
75 | Print a usage message briefly summarizing these command-line |
---|
76 | options and the bug-reporting address, then exit. |
---|
77 | |
---|
78 | `-n' |
---|
79 | `--quiet' |
---|
80 | `--silent' |
---|
81 | By default, SED will print out the pattern space at then end of |
---|
82 | each cycle through the script. These options disable this |
---|
83 | automatic printing, and SED will only produce output when |
---|
84 | explicitly told to via the `p' command. |
---|
85 | |
---|
86 | `-e SCRIPT' |
---|
87 | `--expression=SCRIPT' |
---|
88 | Add the commands in SCRIPT to the set of commands to be run while |
---|
89 | processing the input. |
---|
90 | |
---|
91 | `-f SCRIPT-FILE' |
---|
92 | `--file=SCRIPT-FILE' |
---|
93 | Add the commands contained in the file SCRIPT-FILE to the set of |
---|
94 | commands to be run while processing the input. |
---|
95 | |
---|
96 | If no `-e', `-f', `--expression', or `--file' options are given on |
---|
97 | the command-line, then the first non-option argument on the command |
---|
98 | line is taken to be the SCRIPT to be executed. |
---|
99 | |
---|
100 | If any command-line parameters remain after processing the above, |
---|
101 | these parameters are interpreted as the names of input files to be |
---|
102 | processed. A file name of `-' refers to the standard input stream. |
---|
103 | The standard input will processed if no file names are specified. |
---|
104 | |
---|
105 | |
---|
106 | File: sed.info, Node: sed Programs, Next: Examples, Prev: Invoking SED, Up: Top |
---|
107 | |
---|
108 | SED Programs |
---|
109 | ************ |
---|
110 | |
---|
111 | A SED program consists of one or more SED commands, passed in by one |
---|
112 | or more of the `-e', `-f', `--expression', and `--file' options, or the |
---|
113 | first non-option argument if zero of these options are used. This |
---|
114 | document will refer to "the" SED script; this will be understood to |
---|
115 | mean the in-order catenation of all of the SCRIPTs and SCRIPT-FILEs |
---|
116 | passed in. |
---|
117 | |
---|
118 | Each SED command consists of an optional address or address range, |
---|
119 | followed by a one-character command name and any additional |
---|
120 | command-specific code. |
---|
121 | |
---|
122 | * Menu: |
---|
123 | |
---|
124 | * Addresses:: Selecting lines with SED |
---|
125 | * Regular Expressions:: Overview of regular expression syntax |
---|
126 | * Data Spaces:: Where SED buffers data |
---|
127 | * Common Commands:: Often used commands |
---|
128 | * Other Commands:: Less frequently used commands |
---|
129 | * Programming Commands:: Commands for die-hard SED programmers |
---|
130 | |
---|
131 | |
---|
132 | File: sed.info, Node: Addresses, Next: Regular Expressions, Prev: sed Programs, Up: sed Programs |
---|
133 | |
---|
134 | Selecting lines with SED |
---|
135 | ======================== |
---|
136 | |
---|
137 | Addresses in a SED script can be in any of the following forms: |
---|
138 | `NUMBER' |
---|
139 | Specifying a line number will match only that line in the input. |
---|
140 | (Note that SED counts lines continuously across all input files.) |
---|
141 | |
---|
142 | `FIRST~STEP' |
---|
143 | This GNU extension matches every STEPth line starting with line |
---|
144 | FIRST. In particular, lines will be selected when there exists a |
---|
145 | non-negative N such that the current line-number equals FIRST + (N |
---|
146 | * STEP). Thus, to select the odd-numbered lines, one would use |
---|
147 | `1~2'; to pick every third line starting with the second, `2~3' |
---|
148 | would be used; to pick every fifth line starting with the tenth, |
---|
149 | use `10~5'; and `50~0' is just an obscure way of saying `50'. |
---|
150 | |
---|
151 | `$' |
---|
152 | This address matches the last line of the last file of input. |
---|
153 | |
---|
154 | `/REGEXP/' |
---|
155 | This will select any line which matches the regular expression |
---|
156 | REGEXP. If REGEXP itself includes any `/' characters, each must |
---|
157 | be escaped by a backslash (`\'). |
---|
158 | |
---|
159 | `\%REGEXP%' |
---|
160 | (The `%' may be replaced by any other single character.) |
---|
161 | |
---|
162 | This also matches the regular expression REGEXP, but allows one to |
---|
163 | use a different delimiter than `/'. This is particularly useful |
---|
164 | if the REGEXP itself contains a lot of `/'s, since it avoids the |
---|
165 | tedious escaping of every `/'. If REGEXP itself includes any |
---|
166 | delimiter characters, each must be escaped by a backslash (`\'). |
---|
167 | |
---|
168 | `/REGEXP/I' |
---|
169 | `\%REGEXP%I' |
---|
170 | The `I' modifier to regular-expression matching is a GNU extension |
---|
171 | which causes the REGEXP to be matched in a case-insensitive manner. |
---|
172 | |
---|
173 | If no addresses are given, then all lines are matched; if one |
---|
174 | address is given, then only lines matching that address are matched. |
---|
175 | |
---|
176 | An address range can be specified by specifying two addresses |
---|
177 | separated by a comma (`,'). An address range matches lines starting |
---|
178 | from where the first address matches, and continues until the second |
---|
179 | address matches (inclusively). If the second address is a REGEXP, then |
---|
180 | checking for the ending match will start with the line *following* the |
---|
181 | line which matched the first address. If the second address is a |
---|
182 | NUMBER less than (or equal to) the line matching the first address, |
---|
183 | then only the one line is matched. |
---|
184 | |
---|
185 | Appending the `!' character to the end of an address specification |
---|
186 | will negate the sense of the match. That is, if the `!' character |
---|
187 | follows an address range, then only lines which do *not* match the |
---|
188 | address range will be selected. This also works for singleton |
---|
189 | addresses, and, perhaps perversely, for the null address. |
---|
190 | |
---|
191 | |
---|
192 | File: sed.info, Node: Regular Expressions, Next: Data Spaces, Prev: Addresses, Up: sed Programs |
---|
193 | |
---|
194 | Overview of regular expression syntax |
---|
195 | ===================================== |
---|
196 | |
---|
197 | [[I may add a brief overview of regular expressions at a later date; |
---|
198 | for now see any of the various other documentations for regular |
---|
199 | expressions, such as the AWK info page.]] |
---|
200 | |
---|
201 | |
---|
202 | File: sed.info, Node: Data Spaces, Next: Common Commands, Prev: Regular Expressions, Up: sed Programs |
---|
203 | |
---|
204 | Where SED buffers data |
---|
205 | ====================== |
---|
206 | |
---|
207 | SED maintains two data buffers: the active *pattern* space, and the |
---|
208 | auxiliary *hold* space. In "normal" operation, SED reads in one line |
---|
209 | from the input stream and places it in the pattern space. This pattern |
---|
210 | space is where text manipulations occur. The hold space is initially |
---|
211 | empty, but there are commands for moving data between the pattern and |
---|
212 | hold spaces. |
---|
213 | |
---|
214 | |
---|
215 | File: sed.info, Node: Common Commands, Next: Other Commands, Prev: Data Spaces, Up: sed Programs |
---|
216 | |
---|
217 | Often used commands |
---|
218 | =================== |
---|
219 | |
---|
220 | If you use SED at all, you will quite likely want to know these |
---|
221 | commands. |
---|
222 | |
---|
223 | `#' |
---|
224 | [No addresses allowed.] |
---|
225 | |
---|
226 | The `#' "command" begins a comment; the comment continues until |
---|
227 | the next newline. |
---|
228 | |
---|
229 | If you are concerned about portability, be aware that some |
---|
230 | implementations of SED (which are not POSIX.2 conformant) may only |
---|
231 | support a single one-line comment, and then only when the very |
---|
232 | first character of the script is a `#'. |
---|
233 | |
---|
234 | Warning: if the first two characters of the SED script are `#n', |
---|
235 | then the `-n' (no-autoprint) option is forced. If you want to put |
---|
236 | a comment in the first line of your script and that comment begins |
---|
237 | with the letter `n' and you do not want this behavior, then be |
---|
238 | sure to either use a capital `N', or place at least one space |
---|
239 | before the `n'. |
---|
240 | |
---|
241 | `s/REGEXP/REPLACEMENT/FLAGS' |
---|
242 | (The `/' characters may be uniformly replaced by any other single |
---|
243 | character within any given `s' command.) |
---|
244 | |
---|
245 | The `/' character (or whatever other character is used in its |
---|
246 | stead) can appear in the REGEXP or REPLACEMENT only if it is |
---|
247 | preceded by a `\' character. Also newlines may appear in the |
---|
248 | REGEXP using the two character sequence `\n'. |
---|
249 | |
---|
250 | The `s' command attempts to match the pattern space against the |
---|
251 | supplied REGEXP. If the match is successful, then that portion of |
---|
252 | the pattern space which was matched is replaced with REPLACEMENT. |
---|
253 | |
---|
254 | The REPLACEMENT can contain `\N' (N being a number from 1 to 9, |
---|
255 | inclusive) references, which refer to the portion of the match |
---|
256 | which is contained between the Nth `\(' and its matching `\)'. |
---|
257 | Also, the REPLACEMENT can contain unescaped `&' characters which |
---|
258 | will reference the whole matched portion of the pattern space. To |
---|
259 | include a literal `\', `&', or newline in the final replacement, |
---|
260 | be sure to precede the desired `\', `&', or newline in the |
---|
261 | REPLACEMENT with a `\'. |
---|
262 | |
---|
263 | The `s' command can be followed with zero or more of the following |
---|
264 | FLAGS: |
---|
265 | |
---|
266 | `g' |
---|
267 | Apply the replacement to *all* matches to the REGEXP, not |
---|
268 | just the first. |
---|
269 | |
---|
270 | `p' |
---|
271 | If the substitution was made, then print the new pattern |
---|
272 | space. |
---|
273 | |
---|
274 | `NUMBER' |
---|
275 | Only replace the NUMBERth match of the REGEXP. |
---|
276 | |
---|
277 | `w FILE-NAME' |
---|
278 | If the substitution was made, then write out the result to |
---|
279 | the named file. |
---|
280 | |
---|
281 | `I' |
---|
282 | (This is a GNU extension.) |
---|
283 | |
---|
284 | Match REGEXP in a case-insensitive manner. |
---|
285 | |
---|
286 | `q' |
---|
287 | [At most one address allowed.] |
---|
288 | |
---|
289 | Exit SED without processing any more commands or input. Note that |
---|
290 | the current pattern space is printed if auto-print is not disabled. |
---|
291 | |
---|
292 | `d' |
---|
293 | Delete the pattern space; immediately start next cycle. |
---|
294 | |
---|
295 | `p' |
---|
296 | Print out the pattern space (to the standard output). This |
---|
297 | command is usually only used in conjunction with the `-n' |
---|
298 | command-line option. |
---|
299 | |
---|
300 | Note: some implementations of SED, such as this one, will |
---|
301 | double-print lines when auto-print is not disabled and the `p' |
---|
302 | command is given. Other implementations will only print the line |
---|
303 | once. Both ways conform with the POSIX.2 standard, and so neither |
---|
304 | way can be considered to be in error. Portable SED scripts should |
---|
305 | thus avoid relying on either behavior; either use the `-n' option |
---|
306 | and explicitly print what you want, or avoid use of the `p' |
---|
307 | command (and also the `p' flag to the `s' command). |
---|
308 | |
---|
309 | `n' |
---|
310 | If auto-print is not disabled, print the pattern space, then, |
---|
311 | regardless, replace the pattern space with the next line of input. |
---|
312 | If there is no more input then SED exits without processing any |
---|
313 | more commands. |
---|
314 | |
---|
315 | `{ COMMANDS }' |
---|
316 | A group of commands may be enclosed between `{' and `}' characters. |
---|
317 | (The `}' must appear in a zero-address command context.) This is |
---|
318 | particularly useful when you want a group of commands to be |
---|
319 | triggered by a single address (or address-range) match. |
---|
320 | |
---|
321 | |
---|
322 | File: sed.info, Node: Other Commands, Next: Programming Commands, Prev: Common Commands, Up: sed Programs |
---|
323 | |
---|
324 | Less frequently used commands |
---|
325 | ============================= |
---|
326 | |
---|
327 | Though perhaps less frequently used than those in the previous |
---|
328 | section, some very small yet useful SED scripts can be built with these |
---|
329 | commands. |
---|
330 | |
---|
331 | `y/SOURCE-CHARS/DEST-CHARS/' |
---|
332 | (The `/' characters may be uniformly replaced by any other single |
---|
333 | character within any given `y' command.) |
---|
334 | |
---|
335 | Transliterate any characters in the pattern space which match any |
---|
336 | of the SOURCE-CHARS with the corresponding character in DEST-CHARS. |
---|
337 | |
---|
338 | Instances of the `/' (or whatever other character is used in its |
---|
339 | stead), `\', or newlines can appear in the SOURCE-CHARS or |
---|
340 | DEST-CHARS lists, provide that each instance is escaped by a `\'. |
---|
341 | The SOURCE-CHARS and DEST-CHARS lists *must* contain the same |
---|
342 | number of characters (after de-escaping). |
---|
343 | |
---|
344 | `a\' |
---|
345 | `TEXT' |
---|
346 | [At most one address allowed.] |
---|
347 | |
---|
348 | Queue the lines of text which follow this command (each but the |
---|
349 | last ending with a `\', which will be removed from the output) to |
---|
350 | be output at the end of the current cycle, or when the next input |
---|
351 | line is read. |
---|
352 | |
---|
353 | `i\' |
---|
354 | `TEXT' |
---|
355 | [At most one address allowed.] |
---|
356 | |
---|
357 | Immediately output the lines of text which follow this command |
---|
358 | (each but the last ending with a `\', which will be removed from |
---|
359 | the output). |
---|
360 | |
---|
361 | `c\' |
---|
362 | `TEXT' |
---|
363 | Delete the lines matching the address or address-range, and output |
---|
364 | the lines of text which follow this command (each but the last |
---|
365 | ending with a `\', which will be removed from the output) in place |
---|
366 | of the last line (or in place of each line, if no addresses were |
---|
367 | specified). A new cycle is started after this command is done, |
---|
368 | since the pattern space will have been deleted. |
---|
369 | |
---|
370 | `=' |
---|
371 | [At most one address allowed.] |
---|
372 | |
---|
373 | Print out the current input line number (with a trailing newline). |
---|
374 | |
---|
375 | `l' |
---|
376 | Print the pattern space in an unambiguous form: non-printable |
---|
377 | characters (and the `\' character) are printed in C-style escaped |
---|
378 | form; long lines are split, with a trailing `\' character to |
---|
379 | indicate the split; the end of each line is marked with a `$'. |
---|
380 | |
---|
381 | `r FILENAME' |
---|
382 | [At most one address allowed.] |
---|
383 | |
---|
384 | Queue the contents of FILENAME to be read and inserted into the |
---|
385 | output stream at the end of the current cycle, or when the next |
---|
386 | input line is read. Note that if FILENAME cannot be read, it is |
---|
387 | treated as if it were an empty file, without any error indication. |
---|
388 | |
---|
389 | `w FILENAME' |
---|
390 | Write the pattern space to FILENAME. The FILENAME will be created |
---|
391 | (or truncated) before the first input line is read; all `w' |
---|
392 | commands (including instances of `w' flag on successful `s' |
---|
393 | commands) which refer to the same FILENAME are output through the |
---|
394 | same FILE stream. |
---|
395 | |
---|
396 | `D' |
---|
397 | Delete text in the pattern space up to the first newline. If any |
---|
398 | text is left, restart cycle with the resultant pattern space |
---|
399 | (without reading a new line of input), otherwise start a normal |
---|
400 | new cycle. |
---|
401 | |
---|
402 | `N' |
---|
403 | Add a newline to the pattern space, then append the next line of |
---|
404 | input to the pattern space. If there is no more input then SED |
---|
405 | exits without processing any more commands. |
---|
406 | |
---|
407 | `P' |
---|
408 | Print out the portion of the pattern space up to the first newline. |
---|
409 | |
---|
410 | `h' |
---|
411 | Replace the contents of the hold space with the contents of the |
---|
412 | pattern space. |
---|
413 | |
---|
414 | `H' |
---|
415 | Append a newline to the contents of the hold space, and then |
---|
416 | append the contents of the pattern space to that of the hold space. |
---|
417 | |
---|
418 | `g' |
---|
419 | Replace the contents of the pattern space with the contents of the |
---|
420 | hold space. |
---|
421 | |
---|
422 | `G' |
---|
423 | Append a newline to the contents of the pattern space, and then |
---|
424 | append the contents of the hold space to that of the pattern space. |
---|
425 | |
---|
426 | `x' |
---|
427 | Exchange the contents of the hold and pattern spaces. |
---|
428 | |
---|
429 | |
---|
430 | File: sed.info, Node: Programming Commands, Prev: Other Commands, Up: sed Programs |
---|
431 | |
---|
432 | Commands for die-hard SED programmers |
---|
433 | ===================================== |
---|
434 | |
---|
435 | In most cases, use of these commands indicates that you are probably |
---|
436 | better off programming in something like PERL. But occasionally one is |
---|
437 | committed to sticking with SED, and these commands can enable one to |
---|
438 | write quite convoluted scripts. |
---|
439 | |
---|
440 | `: LABEL' |
---|
441 | [No addresses allowed.] |
---|
442 | |
---|
443 | Specify the location of LABEL for the `b' and `t' commands. In |
---|
444 | all other respects, a no-op. |
---|
445 | |
---|
446 | `b LABEL' |
---|
447 | Unconditionally branch to LABEL. The LABEL may be omitted, in |
---|
448 | which case the next cycle is started. |
---|
449 | |
---|
450 | `t LABEL' |
---|
451 | Branch to LABEL only if there has been a successful `s'ubstitution |
---|
452 | since the last input line was read or `t' branch was taken. The |
---|
453 | LABEL may be omitted, in which case the next cycle is started. |
---|
454 | |
---|
455 | |
---|
456 | File: sed.info, Node: Examples, Next: Limitations, Prev: sed Programs, Up: Top |
---|
457 | |
---|
458 | Some sample scripts |
---|
459 | ******************* |
---|
460 | |
---|
461 | [[Not this release, sorry. But check out the scripts in the |
---|
462 | testsuite directory, and the amazing dc.sed script in the top-level |
---|
463 | directory of this distribution.]] |
---|
464 | |
---|
465 | |
---|
466 | File: sed.info, Node: Limitations, Next: Other Resources, Prev: Examples, Up: Top |
---|
467 | |
---|
468 | About the (non-)limitations on line length |
---|
469 | ****************************************** |
---|
470 | |
---|
471 | For those who want to write portable SED scripts, be aware that some |
---|
472 | implementations have been known to limit line lengths (for the pattern |
---|
473 | and hold spaces) to be no more than 4000 bytes. The POSIX.2 standard |
---|
474 | specifies that conforming SED implementations shall support at least |
---|
475 | 8192 byte line lengths. GNU SED has no built-in limit on line length; |
---|
476 | as long as SED can malloc() more (virtual) memory, it will allow lines |
---|
477 | as long as you care to feed it (or construct within it). |
---|
478 | |
---|
479 | |
---|
480 | File: sed.info, Node: Other Resources, Next: Reporting Bugs, Prev: Limitations, Up: Top |
---|
481 | |
---|
482 | Other resources for learning about SED |
---|
483 | ************************************** |
---|
484 | |
---|
485 | In addition to several books that have been written about SED |
---|
486 | (either specifically or as chapters in books which discuss shell |
---|
487 | programming), one can find out more about SED (including suggestions of |
---|
488 | a few books) from the FAQ for the seders mailing list, available from |
---|
489 | any of: |
---|
490 | `http://www.dbnet.ece.ntua.gr/~george/sed/sedfaq.html' |
---|
491 | `http://www.ptug.org/sed/sedfaq.htm' |
---|
492 | `http://www.wollery.demon.co.uk/sedtut10.txt' |
---|
493 | |
---|
494 | There is an informal "seders" mailing list manually maintained by Al |
---|
495 | Aab. To subscribe, send e-mail to <af137@torfree.net> with a brief |
---|
496 | description of your interest. |
---|
497 | |
---|
498 | |
---|
499 | File: sed.info, Node: Reporting Bugs, Next: Concept Index, Prev: Other Resources, Up: Top |
---|
500 | |
---|
501 | Reporting bugs |
---|
502 | ************** |
---|
503 | |
---|
504 | Email bug reports to <bug-gnu-utils@gnu.org>. Be sure to include |
---|
505 | the word "sed" somewhere in the "Subject:" field. |
---|
506 | |
---|
507 | |
---|
508 | File: sed.info, Node: Concept Index, Next: Command and Option Index, Prev: Reporting Bugs, Up: Top |
---|
509 | |
---|
510 | Concept Index |
---|
511 | ************* |
---|
512 | |
---|
513 | This is a general index of all issues discussed in this manual, with |
---|
514 | the exception of the SED commands and command-line options. |
---|
515 | |
---|
516 | * Menu: |
---|
517 | |
---|
518 | * Adding a block of text after a line: Other Commands. |
---|
519 | * Address, as a regular expression: Addresses. |
---|
520 | * Address, last line: Addresses. |
---|
521 | * Address, numeric: Addresses. |
---|
522 | * Addresses, in SED scripts: Addresses. |
---|
523 | * Addtional reading about SED: Other Resources. |
---|
524 | * Append hold space to pattern space: Other Commands. |
---|
525 | * Append next input line to pattern space: Other Commands. |
---|
526 | * Append pattern space to hold space: Other Commands. |
---|
527 | * Backreferences, in regular expressions: Common Commands. |
---|
528 | * Branch to a label, if s/// succeeded: Programming Commands. |
---|
529 | * Branch to a label, unconditionally: Programming Commands. |
---|
530 | * Buffer spaces, pattern and hold: Data Spaces. |
---|
531 | * Bugs, reporting: Reporting Bugs. |
---|
532 | * Case-insensitive matching: Common Commands. |
---|
533 | * Caveat -- #n on first line: Common Commands. |
---|
534 | * Caveat -- p command and -n flag: Common Commands. |
---|
535 | * Command groups: Common Commands. |
---|
536 | * Comments, in scripts: Common Commands. |
---|
537 | * Conditional branch: Programming Commands. |
---|
538 | * Copy hold space into pattern space: Other Commands. |
---|
539 | * Copy pattern space into hold space: Other Commands. |
---|
540 | * Delete first line from pattern space: Other Commands. |
---|
541 | * Deleting lines: Common Commands. |
---|
542 | * Exchange hold space with pattern space: Other Commands. |
---|
543 | * Excluding lines: Addresses. |
---|
544 | * Files to be processed as input: Invoking SED. |
---|
545 | * Flow of control in scripts: Programming Commands. |
---|
546 | * Global substitution: Common Commands. |
---|
547 | * GNU extensions, I modifier <1>: Common Commands. |
---|
548 | * GNU extensions, I modifier: Addresses. |
---|
549 | * GNU extensions, N~M addresses: Addresses. |
---|
550 | * GNU extensions, unlimited line length: Limitations. |
---|
551 | * Goto, in scripts: Programming Commands. |
---|
552 | * Grouping commands: Common Commands. |
---|
553 | * Hold space, appending from pattern space: Other Commands. |
---|
554 | * Hold space, appending to pattern space: Other Commands. |
---|
555 | * Hold space, copy into pattern space: Other Commands. |
---|
556 | * Hold space, copying pattern space into: Other Commands. |
---|
557 | * Hold space, definition: Data Spaces. |
---|
558 | * Hold space, exchange with pattern space: Other Commands. |
---|
559 | * Insert text from a file: Other Commands. |
---|
560 | * Inserting a block of text before a line: Other Commands. |
---|
561 | * Labels, in scripts: Programming Commands. |
---|
562 | * Last line, selecting: Addresses. |
---|
563 | * Line number, print: Other Commands. |
---|
564 | * Line selection: Addresses. |
---|
565 | * Line, selecting by number: Addresses. |
---|
566 | * Line, selecting by regular expression match: Addresses. |
---|
567 | * Line, selecting last: Addresses. |
---|
568 | * List pattern space: Other Commands. |
---|
569 | * Next input line, append to pattern space: Other Commands. |
---|
570 | * Next input line, replace pattern space with: Common Commands. |
---|
571 | * Parenthesized substrings: Common Commands. |
---|
572 | * Pattern space, definition: Data Spaces. |
---|
573 | * Portability, comments: Common Commands. |
---|
574 | * Portability, line length limitations: Limitations. |
---|
575 | * Portability, p command and -n flag: Common Commands. |
---|
576 | * Print first line from pattern space: Other Commands. |
---|
577 | * Print line number: Other Commands. |
---|
578 | * Print selected lines: Common Commands. |
---|
579 | * Print unambiguous representation of pattern space: Other Commands. |
---|
580 | * Printing text after substitution: Common Commands. |
---|
581 | * Quitting: Common Commands. |
---|
582 | * Range of lines: Addresses. |
---|
583 | * Read next input line: Common Commands. |
---|
584 | * Read text from a file: Other Commands. |
---|
585 | * Replace hold space with copy of pattern space: Other Commands. |
---|
586 | * Replace pattern space with copy of hold space: Other Commands. |
---|
587 | * Replace specific input lines: Other Commands. |
---|
588 | * Replacing all text matching regexp in a line: Common Commands. |
---|
589 | * Replacing only Nth match of regexp in a line: Common Commands. |
---|
590 | * Replacing text matching regexp: Common Commands. |
---|
591 | * Replacing text matching regexp, options: Common Commands. |
---|
592 | * Script structure: sed Programs. |
---|
593 | * Script, from a file: Invoking SED. |
---|
594 | * Script, from command line: Invoking SED. |
---|
595 | * SED program structure: sed Programs. |
---|
596 | * Selected lines, replacing: Other Commands. |
---|
597 | * Selecting lines to process: Addresses. |
---|
598 | * Selecting non-matching lines: Addresses. |
---|
599 | * Several lines, selecting: Addresses. |
---|
600 | * Slash character, in regular expressions: Addresses. |
---|
601 | * Spaces, pattern and hold: Data Spaces. |
---|
602 | * Standard input, processing as input: Invoking SED. |
---|
603 | * Stream editor: Introduction. |
---|
604 | * Substitution of text: Common Commands. |
---|
605 | * Substitution of text, options: Common Commands. |
---|
606 | * Text, appending: Other Commands. |
---|
607 | * Text, insertion: Other Commands. |
---|
608 | * Transliteration: Other Commands. |
---|
609 | * Usage summary, printing: Invoking SED. |
---|
610 | * Version, printing: Invoking SED. |
---|
611 | * Write result of a substitution to file: Common Commands. |
---|
612 | * Write to a file: Other Commands. |
---|
613 | |
---|
614 | |
---|
615 | File: sed.info, Node: Command and Option Index, Prev: Concept Index, Up: Top |
---|
616 | |
---|
617 | Command and Option Index |
---|
618 | ************************ |
---|
619 | |
---|
620 | This is an alphabetical list of all SED commands and command-line |
---|
621 | opions. |
---|
622 | |
---|
623 | * Menu: |
---|
624 | |
---|
625 | * # (comment) command: Common Commands. |
---|
626 | * --expression: Invoking SED. |
---|
627 | * --file: Invoking SED. |
---|
628 | * --help: Invoking SED. |
---|
629 | * --quiet: Invoking SED. |
---|
630 | * --silent: Invoking SED. |
---|
631 | * --version: Invoking SED. |
---|
632 | * -e: Invoking SED. |
---|
633 | * -f: Invoking SED. |
---|
634 | * -h: Invoking SED. |
---|
635 | * -n: Invoking SED. |
---|
636 | * -n, forcing from within a script: Common Commands. |
---|
637 | * -V: Invoking SED. |
---|
638 | * : (label) command: Programming Commands. |
---|
639 | * = (print line number) command: Other Commands. |
---|
640 | * a (append text lines) command: Other Commands. |
---|
641 | * b (branch) command: Programming Commands. |
---|
642 | * c (change to text lines) command: Other Commands. |
---|
643 | * D (delete first line) command: Other Commands. |
---|
644 | * d (delete) command: Common Commands. |
---|
645 | * G (appending Get) command: Other Commands. |
---|
646 | * g (get) command: Other Commands. |
---|
647 | * H (append Hold) command: Other Commands. |
---|
648 | * h (hold) command: Other Commands. |
---|
649 | * i (insert text lines) command: Other Commands. |
---|
650 | * l (list unambiguously) command: Other Commands. |
---|
651 | * N (append Next line) command: Other Commands. |
---|
652 | * n (next-line) command: Common Commands. |
---|
653 | * P (print first line) command: Other Commands. |
---|
654 | * p (print) command: Common Commands. |
---|
655 | * q (quit) command: Common Commands. |
---|
656 | * r (read file) command: Other Commands. |
---|
657 | * s (substitute) command: Common Commands. |
---|
658 | * s command, option flags: Common Commands. |
---|
659 | * t (conditional branch) command: Programming Commands. |
---|
660 | * w (write file) command: Other Commands. |
---|
661 | * x (eXchange) command: Other Commands. |
---|
662 | * y (transliterate) command: Other Commands. |
---|
663 | * {} command grouping: Common Commands. |
---|
664 | |
---|
665 | |
---|
666 | |
---|
667 | Tag Table: |
---|
668 | Node: Top1042 |
---|
669 | Node: Introduction1762 |
---|
670 | Node: Invoking SED2308 |
---|
671 | Node: sed Programs3751 |
---|
672 | Node: Addresses4736 |
---|
673 | Node: Regular Expressions7443 |
---|
674 | Node: Data Spaces7802 |
---|
675 | Node: Common Commands8325 |
---|
676 | Node: Other Commands12456 |
---|
677 | Node: Programming Commands16367 |
---|
678 | Node: Examples17266 |
---|
679 | Node: Limitations17560 |
---|
680 | Node: Other Resources18218 |
---|
681 | Node: Reporting Bugs19000 |
---|
682 | Node: Concept Index19248 |
---|
683 | Node: Command and Option Index24957 |
---|
684 | |
---|
685 | End Tag Table |
---|