Linux shell Programming Notes-understanding sed__ block chain

Source: Internet
Author: User

my first understanding of sed

Sed is an editor, a command-style text editor. SED can be executed as a command in a terminal, or it can be saved as a SED script text-an executable sed script file, and then execute the script file. The SED editor, like the VI and VIM editors, is used to manipulate text files, but it differs from VI and VIM in 2 points:

1 sed editor does not have a visual interface (maybe I did not learn);

2 sed By default, instead of manipulating the text directly, it is a copy of the action text.


Ii. further understanding of the SED

1, read the source and read the text of the way

By default, sed reads text from standard input output or specifies specific text files, both of which are the source of sed. Sed reads are read by row, and the default starts at line 1th.


2, the way to manipulate the text

The way to manipulate text is divided into: Append, insert, modify, delete. The process of manipulating text probably has the following steps:

(1) reading the text;

2 position to the specific text position.

3) Execute the Operation command.


3, Save

Because the SED operation is a copy of the text, so even if the completion of the Append, insert, modify, delete and other operations will not change the source, generally through redirection to save.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.