
GNU ed 1.15 - lelf
http://lists.gnu.org/archive/html/info-gnu/2019-01/msg00003.html
======
smhenderson
I'm sure most of us have seen this but for those who have not - ed is the
standard editor!

[https://www.gnu.org/fun/jokes/ed-msg.html](https://www.gnu.org/fun/jokes/ed-
msg.html)

~~~
karmickoala
I googled the author, Patrick J. LoPresti, trying to know more about him and
what he is up to. I haven't looked deeply, but I found this easter egg on the
game Wasteland 2 [1]:

    
    
      1992 M.I.T. Class Ring
      Description
      2 city skylines are etched along the edges of this gold ring. 
      The face features a busy beaver. The name "Patrick J. LoPresti" 
      is engraved in script on the interior.
    

I wonder if it's a tribute because of his joke.

[1]:
[https://wasteland.gamepedia.com/1992_M.I.T_Class_Ring](https://wasteland.gamepedia.com/1992_M.I.T_Class_Ring)

~~~
ksherlock
In the kickstarter, $2,000 let you design a personalized item. Wasteland was
released in 1988 so somebody who graduated in 1992 may have had fond
collegiate memories.

------
geocar
I maintain a lightly modified v6 ed[1] for people who want the real deal.

[1]: [https://github.com/geocar/ed-v6](https://github.com/geocar/ed-v6)

~~~
bumbledraven
According to the page, that version of ed is the editor on which you learned
Unix. What editor do you use on Unix these days?

~~~
geocar
I still use ed for a lot of small edits. I also use vi (not vim) a lot: having
multiple screens means I can leave an editor open with code for a long time.

------
Topolomancer
It's interesting to see that `ed` is still going strong. I am curious: is
anyone on HN using it (semi-)regularly? If so, what are its advantages over
other editors (other than maybe the fact that it is probably the smallest
editor you can get, unless you do all your editing on the shell)?

I have to admit that I _never_ encountered a situation where `ed` might have
been my tool of choice.

~~~
mbrock
I use it when I for some reason need to do something like "delete line 398".
Just open ed and do "398d" and "wq". That's my habit for deleting stale
entries in ~/.ssh/known_hosts.

For a while I maintained a .html blog using only ed, just for the fun of
abstaining from conveniences and learning to use an ancient program. It's
somehow nice to know that it's possible.

~~~
shittyadmin
They recently added ssh-keygen -R to remove entries from the known_hosts file,
it's been a big time saver for me. I wish more server providers would tell you
the keys your server is using though so you don't have to play the TOFU
(Trust-On-First-Use) game.

~~~
acdha
In this case, recently means 2005 when OpenSSH 4.0 was released so you can
assume it exists even on things like Red Hat:

[https://www.openssh.com/txt/release-4.0](https://www.openssh.com/txt/release-4.0)

~~~
shittyadmin
Interesting, I only learned of it recently, it seems a patch was added to
Ubuntu called "mention-ssh-keygen-on-keychange.patch" which puts explicit
mention of ssh-keygen -R into the error message, I had assumed it was part of
openssh itself and arrived at the same time.

This patch was explicitly rejected in upstream openssh as they said it could
lead people to copy and paste it without considering attacks - but ignored the
fact that by just telling people what file it was in, many people just deleted
the file in response and those who did it right, deleting just the relevant
line in cases where a key change was expected like my situation, never
discovered the easier ssh-keygen -R method.

Perhaps they shouldn't offer a copy and paste solution, but mentioning that
ssh-keygen is capable of it and to see the docs would be nice at least...

~~~
acdha
This is a common problem with open source projects which don't have huge
doc/PR teams — I've seen so many times where someone reinvented something
because it was obscurely documented or used a different term than they thought
to search for.

------
red_phone
It's going strong enough to justify someone publishing a book on it [1] just
last year.

[1] [https://www.amazon.com/Ed-Mastery-Standard-Unix-Editor-
ebook...](https://www.amazon.com/Ed-Mastery-Standard-Unix-Editor-
ebook/dp/B07BVBSDNZ)

~~~
mcguire
" _Ed Mastery will help you:_

" _...._

" _•insert, remove, and mangle text_ "

Yep. That's ed.

------
mbrock
Pretty interesting that there are to this day updates in the POSIX standard
for ed...

~~~
rbanffy
Yes... That also caught my eye... I guess it is helpful to have a sensible
implementation-neutral standard to prevent implementations from drifting too
much. This could be something like the C updates that fix undefined behavior.

~~~
merlincorey
> This could be something like the C updates that fix undefined behavior.

Undefined behavior isn't necessarily something that should be fixed, in all
cases. In some cases, it explicitly cannot be fixed, as it is undefined
explicitly due to known differences in machines.

~~~
Skunkleton
Undefined != implementation defined. The more stuff that gets moved to
implementation defined the better.

~~~
rbanffy
If everything is implementation defined, why bother with a standard?

~~~
Skunkleton
[https://stackoverflow.com/a/4105123](https://stackoverflow.com/a/4105123)

Why would you want undefined behavior?

~~~
merlincorey
To allow implementations slack to do things in the way that works best for
them, in some cases of undefined behavior -- but not all of them.

If you have not read it before, you might find "The Value of Undefined
Behavior" informative:
[https://nullprogram.com/blog/2018/07/20/](https://nullprogram.com/blog/2018/07/20/)

~~~
Skunkleton
The whole point of implementation defined behavior is to allow the individual
implementations slack. I'm not saying C should be 100% UB free, just that
implementation defined is preferable to undefined.

------
mywittyname
It's amazing that such a long-lived, ubiquitous program would be only version
1.15.

~~~
opencl
It took over a decade to hit 1.0. But it's simple enough there's never been a
whole lot that needs changed. Whole thing is around 3000 lines of code. There
was a memory leak that took over 20 years to find and fix though.

I uploaded the whole changelog[1] if anyone wants to read it in a slightly
more convenient way than downloading the source tarball.

[1] [https://pastebin.com/raw/6XkJCjsU](https://pastebin.com/raw/6XkJCjsU)

~~~
jandrese
Does ed support Unicode? That would be one big change that the original
designers could not foresee.

~~~
opencl
ed predates the existence of unicode and has made no changes to support it. So
it does not "support" unicode but works fine with UTF-8 if your terminal
supports it.

As far as ed is concerned some bytes are being pushed around between
stdin/stdout/your file, and it does not mangle them so everything works.

------
hjek
For those who can't get enough ed, there's also edbrowse[0], an the ed-like
web browser (and editor, and mail client, ...)

[0]: [http://edbrowse.org/](http://edbrowse.org/)

~~~
drivers99
Ah, that page reminded me ("[Edbrowse] was originally written for blind
users") of my blind friend from high school who used ed (if connected to unix
remotely) or the similar DOS program, EDLIN (to edit locally). This was around
1992. He had a laptop with a fancy add on card and BIOS which would do text to
speech of whatever was in the video cards text-mode character buffers. He
could have it read character by character if needed. (He wrote most of the C
code for a programming competition we were in. He never indented though...)

------
cygned
The following article got me interested in ed. It shows how to automate a
seemingly difficult to automate operation in an elegant way.

[https://jvns.ca/blog/2018/05/11/batch-editing-files-with-
ed/](https://jvns.ca/blog/2018/05/11/batch-editing-files-with-ed/)

------
arianvanp
I had the pleasure of trying out ed(1) in its natural habitat last week at
CCC, which was very nice
[https://twitter.com/ProgrammerDude/status/107899350944788070...](https://twitter.com/ProgrammerDude/status/1078993509447880705?s=19)

------
tincholio
?

~~~
tincholio
Whoever downvoted has obviously never used ed!

------
wglb
Nice.

One thing that I miss and apparently is still not there is the ability to use
'*' in place of '1,$' that was in the MWC Coherent version.

~~~
bch
Off the top of my head, does ‘%’ capture all the lines?

(It does that, or stands-in for the actual filename, or something else :/ )

~~~
wglb
Ha! Yes it does. Thanks.

------
fastaguy88
Where is GNU TECO (the editor I wrote my PhD thesis with in 1975)? (I'm very
curious what my fingers remember 40+ years later.)

~~~
merlincorey
It's EMACS now, which started life as a collection of TECO macros.

In 1972, Carl Mikkelson produced the first collection of TECO Editor MACroS.

In 1976, Richard Stallman collected all publicly available TECO Editor MACroS
into a single distribution, creating EMACS.

------
michaelmrose
A video showing a guy with nc and bash adding clojure repl support to ed.

[https://lambdaisland.com/episodes/ultimate-dev-
setup](https://lambdaisland.com/episodes/ultimate-dev-setup)

------
jancsika
> * The configure script now accepts appending options to CFLAGS using the
> syntax 'CFLAGS+=OPTIONS'.

Was this due to an autotools version bump?

------
purplezooey
Real Python programmers write all their code in ed

------
Ice_cream_suit
This is the best news ever!

Really made my day!

------
Koshkin
[https://www.google.com/maps/@42.2138438,-71.0046955,3a,15y,4...](https://www.google.com/maps/@42.2138438,-71.0046955,3a,15y,47.98h,89.35t/data=!3m6!1e1!3m4!1sRHRaSB4hFWoka6ZfXPGJjg!2e0!7i13312!8i6656)

~~~
lucb1e
It's a picture of a street sign saying "WYNOT RD", for those wondering.

