DEV Community

Evan Jones
Evan Jones

Posted on

2 1

ed is the standard text editor.

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:

  1. Append text to a buffer.
  2. Print text from a buffer.
  3. Replace lines in a buffer.
  4. Deleted line from a buffer.
  5. Read files.
  6. Write files.
  7. Put/yank text.
  8. 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.

using ed

Sure beats the hell out of using punch cards.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more