1242
1242
This solution by Bruno Haible is very clever and smart because it
1243
1243
uses a single buffer; if you don't have this limitation, the algorithm
1244
used in *Note Numbering lines: cat -n, is faster. It works by
1244
used in *note Numbering lines: cat -n, is faster. It works by
1245
1245
replacing trailing nines with an underscore, then using multiple `s'
1246
1246
commands to increment the last digit, and then again substituting
1247
1247
underscores with zeros.
2274
2274
* Flow of control in scripts: Programming Commands.
2276
2276
* Global substitution: The "s" Command. (line 51)
2277
* GNU extensions, /dev/stderr file <1>: The "s" Command. (line 78)
2278
* GNU extensions, /dev/stderr file: Other Commands. (line 88)
2277
* GNU extensions, /dev/stderr file <1>: Other Commands. (line 88)
2278
* GNU extensions, /dev/stderr file: The "s" Command. (line 78)
2279
2279
* GNU extensions, /dev/stdin file <1>: Extended Commands. (line 53)
2280
2280
* GNU extensions, /dev/stdin file: Other Commands. (line 78)
2281
* GNU extensions, /dev/stdout file <1>: Invoking sed. (line 149)
2281
* GNU extensions, /dev/stdout file <1>: Other Commands. (line 88)
2282
2282
* GNU extensions, /dev/stdout file <2>: The "s" Command. (line 78)
2283
* GNU extensions, /dev/stdout file: Other Commands. (line 88)
2283
* GNU extensions, /dev/stdout file: Invoking sed. (line 149)
2284
2284
* GNU extensions, 0 address <1>: Reporting Bugs. (line 103)
2285
2285
* GNU extensions, 0 address: Addresses. (line 78)
2286
2286
* GNU extensions, 0,ADDR2 addressing: Addresses. (line 78)
2292
2292
* GNU extensions, checking for their presence: Extended Commands.
2294
2294
* GNU extensions, disabling: Invoking sed. (line 81)
2295
* GNU extensions, emptying pattern space <1>: Extended Commands.
2297
* GNU extensions, emptying pattern space: Reporting Bugs. (line 130)
2295
* GNU extensions, emptying pattern space <1>: Reporting Bugs. (line 130)
2296
* GNU extensions, emptying pattern space: Extended Commands. (line 85)
2298
2297
* GNU extensions, evaluating Bourne-shell commands <1>: Extended Commands.
2300
2299
* GNU extensions, evaluating Bourne-shell commands: The "s" Command.
2302
2301
* GNU extensions, extended regular expressions: Invoking sed. (line 113)
2303
2302
* GNU extensions, g and NUMBER modifier interaction in s command: The "s" Command.
2305
* GNU extensions, I modifier <1>: Addresses. (line 49)
2306
* GNU extensions, I modifier: The "s" Command. (line 94)
2307
* GNU extensions, in-place editing <1>: Invoking sed. (line 51)
2308
* GNU extensions, in-place editing: Reporting Bugs. (line 85)
2304
* GNU extensions, I modifier <1>: The "s" Command. (line 94)
2305
* GNU extensions, I modifier: Addresses. (line 49)
2306
* GNU extensions, in-place editing <1>: Reporting Bugs. (line 85)
2307
* GNU extensions, in-place editing: Invoking sed. (line 51)
2309
2308
* GNU extensions, L command: Extended Commands. (line 26)
2310
2309
* GNU extensions, M modifier: The "s" Command. (line 99)
2311
2310
* GNU extensions, modifiers and the empty regular expression: Addresses.
2321
2320
* GNU extensions, returning an exit code: Common Commands. (line 30)
2322
2321
* GNU extensions, setting line length: Other Commands. (line 65)
2323
* GNU extensions, special escapes <1>: Escapes. (line 6)
2324
* GNU extensions, special escapes: Reporting Bugs. (line 78)
2322
* GNU extensions, special escapes <1>: Reporting Bugs. (line 78)
2323
* GNU extensions, special escapes: Escapes. (line 6)
2325
2324
* GNU extensions, special two-address forms: Addresses. (line 78)
2326
2325
* GNU extensions, subprocesses <1>: Extended Commands. (line 12)
2327
2326
* GNU extensions, subprocesses: The "s" Command. (line 85)
2328
* GNU extensions, to basic regular expressions <1>: Regular Expressions.
2327
* GNU extensions, to basic regular expressions <1>: Reporting Bugs.
2329
* GNU extensions, to basic regular expressions: Regular Expressions.
2330
* GNU extensions, to basic regular expressions <2>: Reporting Bugs.
2332
* GNU extensions, to basic regular expressions: Regular Expressions.
2334
2331
* GNU extensions, two addresses supported by most commands: Other Commands.
2336
2333
* GNU extensions, unlimited line length: Limitations. (line 6)
2354
2351
* Labels, in scripts: Programming Commands.
2356
2353
* Last line, selecting: Addresses. (line 22)
2357
* Line length, setting <1>: Invoking sed. (line 76)
2358
* Line length, setting: Other Commands. (line 65)
2354
* Line length, setting <1>: Other Commands. (line 65)
2355
* Line length, setting: Invoking sed. (line 76)
2359
2356
* Line number, printing: Other Commands. (line 62)
2360
2357
* Line selection: Addresses. (line 6)
2361
2358
* Line, selecting by number: Addresses. (line 8)
2370
2367
* Non-bugs, 0 address: Reporting Bugs. (line 103)
2371
2368
* Non-bugs, in-place editing: Reporting Bugs. (line 85)
2372
* Non-bugs, localization-related: Reporting Bugs. (line 130)
2369
* Non-bugs, localization-related: Reporting Bugs. (line 112)
2373
2370
* Non-bugs, N command on the last line: Reporting Bugs. (line 31)
2374
2371
* Non-bugs, regex syntax clashes: Reporting Bugs. (line 51)
2375
2372
* Parenthesized substrings: The "s" Command. (line 19)
2386
2383
* Print first line from pattern space: Other Commands. (line 110)
2387
2384
* Printing line number: Other Commands. (line 62)
2388
2385
* Printing text unambiguously: Other Commands. (line 65)
2389
* Quitting <1>: Common Commands. (line 30)
2390
* Quitting: Extended Commands. (line 36)
2386
* Quitting <1>: Extended Commands. (line 36)
2387
* Quitting: Common Commands. (line 30)
2391
2388
* Range of lines: Addresses. (line 65)
2392
2389
* Range with start address of zero: Addresses. (line 78)
2393
2390
* Read next input line: Common Commands. (line 44)
2394
* Read text from a file <1>: Other Commands. (line 78)
2395
* Read text from a file: Extended Commands. (line 53)
2391
* Read text from a file <1>: Extended Commands. (line 53)
2392
* Read text from a file: Other Commands. (line 78)
2396
2393
* Reformat pattern space: Extended Commands. (line 26)
2397
2394
* Reformatting paragraphs: Extended Commands. (line 26)
2398
2395
* Replace hold space with copy of pattern space: Other Commands.
2514
Node: Introduction3858
2515
Node: Invoking sed4412
2516
Ref: Invoking sed-Footnote-110503
2517
Ref: Invoking sed-Footnote-210695
2518
Node: sed Programs10794
2519
Node: Execution Cycle11942
2520
Ref: Execution Cycle-Footnote-113120
2521
Node: Addresses13421
2522
Node: Regular Expressions18165
2523
Node: Common Commands26073
2524
Node: The "s" Command28076
2525
Ref: The "s" Command-Footnote-132413
2526
Node: Other Commands32485
2527
Ref: Other Commands-Footnote-137627
2528
Node: Programming Commands37699
2529
Node: Extended Commands38613
2531
Ref: Escapes-Footnote-145632
2532
Node: Examples45823
2533
Node: Centering lines46919
2534
Node: Increment a number47811
2535
Ref: Increment a number-Footnote-149371
2536
Node: Rename files to lower case49491
2537
Node: Print bash environment52194
2538
Node: Reverse chars of lines52949
2539
Ref: Reverse chars of lines-Footnote-153950
2544
Ref: wc -c-Footnote-159411
2553
Node: Limitations67261
2554
Node: Other Resources68102
2555
Node: Reporting Bugs68947
2556
Ref: Reporting Bugs-Footnote-176083
2557
Node: Extended regexps76154
2558
Node: Concept Index77340
2559
Node: Command and Option Index92500
2511
Node: Introduction3867
2512
Node: Invoking sed4421
2513
Ref: Invoking sed-Footnote-110512
2514
Ref: Invoking sed-Footnote-210704
2515
Node: sed Programs10803
2516
Node: Execution Cycle11951
2517
Ref: Execution Cycle-Footnote-113129
2518
Node: Addresses13430
2519
Node: Regular Expressions18174
2520
Node: Common Commands26082
2521
Node: The "s" Command28085
2522
Ref: The "s" Command-Footnote-132422
2523
Node: Other Commands32494
2524
Ref: Other Commands-Footnote-137636
2525
Node: Programming Commands37708
2526
Node: Extended Commands38622
2528
Ref: Escapes-Footnote-145641
2529
Node: Examples45832
2530
Node: Centering lines46928
2531
Node: Increment a number47820
2532
Ref: Increment a number-Footnote-149380
2533
Node: Rename files to lower case49500
2534
Node: Print bash environment52203
2535
Node: Reverse chars of lines52958
2536
Ref: Reverse chars of lines-Footnote-153959
2541
Ref: wc -c-Footnote-159420
2550
Node: Limitations67270
2551
Node: Other Resources68111
2552
Node: Reporting Bugs68956
2553
Ref: Reporting Bugs-Footnote-176092
2554
Node: Extended regexps76163
2555
Node: Concept Index77349
2556
Node: Command and Option Index92298