Clouds and eclipses stain both moon and sun, And loathsome canker lives in sweetest bud. . When first invoked, ed is in command mode. In this mode commands are read from the standard input and executed to manipulate the contents of the editor buffer. This is the primary means of adding text to a file. A line consists of the text up to and including a newline character.
Roses have thorns, and filvers foutians mud.
Clouds and eclipses stain both moon and sun, And loathsome canker lives in sweetest bud. 2 Roses have thorns, and filvers foutians mud. When invoked with a file argument, a copy of file is read into the editor's buffer. Changes are made to this copy and not directly to file itself. Since ed is line-oriented, we have to tell it which line, or range of lines we want to edit.