Hacker News new | past | comments | ask | show | jobs | submit login

Why? We have better alternatives, and clearly things can work without it.



From what I understand, it's used as a scriptable editor in UNIX automation. It may not be used that often, but it's something I think people expect to be there when a particular piece of behaviour is desired. (Not that I've ever used it myself either interactively or scripted).

It also appears to be part of POSIX.

I imagine though that ex would be the more capable alternative, and since vi is also ubiquitous, I guess that makes ex ubiquitous too. So I can see your point.


What better alternatives are there?

Even if you prefer vi for interactive edits, I still prefer ed for small edits.

Then there are times when your terminal is borken (or as somebody mentioned, perhaps even your keyboard is broken), this still happens more often than you think.

Recently I had to use some ajax-term thing which was just awful and completely unable to run vi properly for who knows what reason, anything that depends on curses can not be considered reliable.

But more importantly it is the standard and portable tool for scripting the editing of files.


I'm honestly curious - what's a use case for scripting the editing of files that's not better satisfied by using a scripting language? I see the value of Arch's focus on minimalism more than keeping ed around in this case, but I'm happy to be wrong.

If your terminal is broken, there are plenty of ways (reset, stty sane, whatever) to fix that. I'm also not sure why having an extra binary on my system is a good safety guard against a broken keyboard.

The ajax term case is valid I guess, though I'm not sure how common that is. I was in a case like that a year or so ago and ended up using cat and sed to get the thing back on the network.


Use case for scripting that's not better satisfied by using a scripting language:

Ed reads the entire file. If you need to move back and forth through the file, or move lines from one place to another, or reprocess the same line repeatedly, it can be far more convenient than a scripting language.


There are many editors which will do the job, it is a matter of taste. If you break your terminal by some obscure action, then fix it rather than choosing your entire toolchain around the premise that you will be spending significant time in a broken terminal.

I appreciate historical respect for the tool but this falls short of showing it to be indispensable to everybody.


Because ed is the standard text editor.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: