ed (pronounced "e" "d" -- not "ed" as in Ed, Edd n Eddy) is a line-oriented text editor. ed was originally written by Ken Thompson for use in various UNIX systems. Don't let the man(1) page lie to you: ed is not superseded by full-screen editors such as GNU Emacs or GNU Moe. If you tend to shy away from user interfaces, clinging to your sh(1) prompt to get work done, ed may be another valuable rendezvous for your time out of the meatspace -- after all Vi does mean "visual" editor.
ed doesn't do much without being asked to. What ed does do is:
- Append text to a buffer.
- Print text from a buffer.
- Replace lines in a buffer.
- Deleted line from a buffer.
- Read files.
- Write files.
- Put/yank text.
- Execute shell commands.
That's almost it.
What I'll show you are the bare essentials to using ed. We're going to write a hello world program in ed using the C programming language.
We'll begin by entering a shell prompt, sh(1) will do. Follow along with me in my terminal.
Sure beats the hell out of using punch cards.