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.

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

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay