News for hackers. Stuff that matters.
Re:Actually using ed (2012) by kalleboo on Tuesday December 06, 2016 @09:19AM (#13114709)
> If you’re using any Unix at all, then ed really will always be there, no matter how old or limited the system.

    kalleboo@Synology:~$ ed
    -sh: ed: command not found
    kalleboo@Synology:~$ vi
    ~       VIM - Vi IMproved
ah

Snark aside, it's a very well-written tutorial! I'm sure I'll end up referring to it at some point in the future.

Re:Actually using ed (2012) by HCIdivision17 on Tuesday December 06, 2016 @11:08AM (#13115613)
> Well, unless you’re using Arch Linux.

I would love to know if you're using Arch Linux? There's got to be a good story about why it's not there, if not. Might be fun to hunt down if so (I like historical stories about that sort of decision making).

Re:Actually using ed (2012) by bananaoomarang on Tuesday December 06, 2016 @12:03PM (#13116162)
Going purely off memory here, but I think the discussion on the mailing list went something like:

Why do we include multiple text editors by default?

Good point let’s just pick one for the base install.

Obvious choice is Vi not Ed because more people are familiar with the former.

Re:Actually using ed (2012) by HCIdivision17 on Tuesday December 06, 2016 @01:57PM (#13117242)
Aww. That's not terribly interesting at all. I mean, I get it, and I don't doubt it's validity. It's just so... mundane.

I would have thought there'd be utility in having a very small last-resort utility like ed by default. But then I don't use Vi much (or ed, normally I'm just touching up a file from the command line, so I use nano), so perhaps I'm out of touch.

Re:Actually using ed (2012) by abecedarius on Tuesday December 06, 2016 @01:50PM (#13117186)
ed has seen use in scripts -- for example, in Kernighan & Pike's The UNIX Programming Environment. `diff` can output an ed script to perform a patch, and that's what people used before `patch` was invented to make patching more robust. I'm surprised you can't rely on ed being present.
Re:Actually using ed (2012) by david-given on Tuesday December 06, 2016 @02:20PM (#13117439)
I'm working on a codebase right now which uses ed a lot in scripts. I probably wouldn't write new code which used it --- I like awk --- but it actually does the job pretty well.

Admittedly, the code does date back to 1984 in places.

Re:Actually using ed (2012) by kalleboo on Tuesday December 06, 2016 @11:12PM (#13120414)
It's the custom GNU+Linux distribution on my NAS (Synology), running an ARM CPU
Re:Actually using ed (2012) by jacobvosmaer on Tuesday December 06, 2016 @02:48PM (#13117683)
It's not just Arch. I used to think ed was everywhere, so when I had to write some scripts that would be awful with sed I used ed.

And then it turned out that a lot of the platforms people run the scripts on, they had to install ed explicitly! Ha. Sorry, Arch/Debian/Fedora/Centos/OpenSUSE users.

If you don't believe me, look how many times 'ed' is installed on this page. :) https://gitlab.com/gitlab-org/gitlab-development-kit/blob/ma...

Re:Actually using ed (2012) by thescriptkiddie on Tuesday December 06, 2016 @01:43PM (#13117136)
Vim can mostly emulate ed thanks to ex mode. Just symlink /usr/local/bin/ex to your vim binary.
Re:Actually using ed (2012) by kps on Tuesday December 06, 2016 @10:57AM (#13115506)
Perhaps your system is something Not Unix?
Re:Actually using ed (2012) by lolzors on Tuesday December 06, 2016 @11:10AM (#13115643)
He is on a synology host, so it's likely FreeBSD. Which is pretty friggin unix
Re:Actually using ed (2012) by gkya on Tuesday December 06, 2016 @12:44PM (#13116575)
FreeBSD has ed.