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.