23 comments

[ 1.6 ms ] story [ 52.3 ms ] thread
(comment deleted)
Funny thing about ed: While it is still one of my most common commands, it is also my dad's name. So, I've spent my entire career regularly typing my father's name at work.
I used to use EDLIN on my MS/DOS days...

.

BTW, its FreeDOS version is still being updated fairly frequently. :) Current version 2.24 is from May 2024.
Ah, ed. Back in the mid 80s, I had to teach a course on Unix & its tools - if I remember correctly it was called "Unix - a modern OS". One of those tools was of course ed. We couldn't use vi because the termcap/terminfo settings were screwed up for the physical serial terminals we had - I eventually fixed this & felt very pleased with myself, as those terminal config files are a b*tch.

Still, teaching bash, C and the usual suspects along with ed was very strenuous for the students, and for me - we only ran the course once.

I like ed but I prefer 'sam -d' (the terminal mode of Sam). It has a nice looping construct 'x' and you can open multiple files and do batch edits (with 'X').

There is a Go port of Sam, which is easy to install:

go install 9fans.net/go/cmd/sam@latest

http://sam.cat-v.org/

Aaron have a crossplatform ed in Apl.This is great when you familiar with apl.
When even “IDEs are complete overkill—just use vi” sounds like weakness and the entitlement of modern youth, seek out the ed fan pages!

ed isn’t quite flipping binary toggle switches to load your program, but close enough to deliver the joy of brutal minimalism along with a nostalgic waft of yesteryear.

I don't use ed interactively but find it's really useful in shell scripts that need to edit files - heredocs or piping printf output (like one example in the article; never felt a need for something like his xed). Even used it in a C program via popen() to edit settings in a config file.

ed is underrated.

(I'm responsible for suggesting GNU ed accept posix EREs; think I got the idea from NetBSD's version)

ed is the first program I put in exaequOS (https://exaequos.com), an OS fully running in the Web browser. For testing ed, you can open a terminal and type 'ed'
Forget it, you won't be able to be funnier than the 1991 TRUE PATH TO NIRVANA. This is unbeatable.
After reading this article, I need to learn :wq for ed.

Edit - I suppose that shouldn't have been surprising:

w

q

Both GNU ed and OpenBSD ed support wq as an extension to POSIX. But yeah, it all depends on whether you want to stick by POSIX or common practice. I personally prefer wq for interactive sessions and w\nq for scripts.
Is there really an advantage to using Ed instead of vim in any situation whatsoever? (Assuming you're totally comfortable with vim)
when you're using a teletype terminal