Chapter Summary

 < Day Day Up > 

The sed (stream editor) utility is a batch (noninteractive) editor. It takes its input from files you specify on the command line or from standard input. Unless you redirect the output from sed, it goes to standard output.

A sed program consists of one or more lines with the following syntax:

 [address[ ,address] ] instruction [argument-list] 

The addresses are optional. If you omit the address, sed processes all lines of input. The instruction is the editing instruction that modifies the text. The addresses select the line(s) the instruction part of the command operates on. The number and kinds of arguments in the argument-list depend on the instruction.

In addition to basic instructions, sed includes some powerful advanced instructions. One set of these instructions allows sed programs to store data temporarily in a buffer called the Hold space. Other instructions provide unconditional and conditional branching in sed programs.

     < Day Day Up > 


    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    A Practical Guide to LinuxR Commands, Editors, and Shell Programming
    ISBN: 131478230
    EAN: N/A
    Year: 2005
    Pages: 213

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net