Live data from Hacker News

Ed is the standard text editor (2014)

wiki.c2.com

51–60 of 125 posts

Re: Ed is the standard text editor (2014)

#51
post #27

Perhaps it's better to see for a minute how people used this kind of editors when they first appeared, than to keep reading about them for ages: https://youtu.be/b6URa-PTqfA?t=100 (BBC from '79, mentioning how people start working from home with the aid of newfangled microcomputers and network connectivity). I'm reminded most of all of the fdisk util, where the workflow is pretty much the same: print, modify, print,…

That video is marvellous, when you compare it to today's technology and how it's used. The angsty "does it mean we'll all have to learn to type?", the female BASIC programmer working from home on her terminal with printer as a display. Great stuff.

Re: Ed is the standard text editor (2014)

#52

I have written several scripts -- some throwaway, some not -- that use ed. If you know what you need to do to edit a file and need it automated, ed is just super handy. Here is a shell script that deletes all comments from a yaml file, then comments out a particular key: ed $file

In most cases I find `sed -i` to be more convenient than using ed in scripts, but the paradigm is a little different.

I finally had an occasion to write a .sed script a few weeks ago and it was one of the highlights of my career.

Re: Ed is the standard text editor (2014)

#53
post #24
post #4

People make fun of ed, but the command line is basically ed with the ability to execute.

This enlightens me as to how people can code with ed (and why Ken Thompson famously said 'I don't want to see the state of the file when I'm editing.'). It's basically a REPL for writing code. Same as psql, the commands you use to view the state of the text (database) are different from the commands you use to edit the state of the text (database). Still sucks though. Even in psql I regularly drop into vim with \e to…

Just keep it in your head. ed must have been a decent upgrade from punched cards.

Re: Ed is the standard text editor (2014)

#55

?

> Ken Thompson has an automobile which he helped design. Unlike most automobiles, it has neither speedometer, nor gas gauge, nor any of the other numerous idiot lights which plague the modern driver. Rather, if the driver makes a mistake, a giant “?” lights up in the center of the dashboard. “The experienced driver,” says Thompson, “will usually know what’s wrong.”

-- The Unix Hater's Handbook pp. 57

Re: Ed is the standard text editor (2014)

#56
post #18

Earlier quoted context omitted.

"oh no i reinstalled the os on my vps and now ssh has it on good authority (said authority is line 68) that someone is doing something nasty" ed .ssh/config 68d wq done, didnt fill my terminal with vim or emacs, didnt tab over to my gui editor then back again also it's a nicely "semantic"/compact/comprehensible way of expressing patches in things like portfiles or nix expressions: postPatch = '' ed Makefile etc etc s…

I always used sed for deleting lines from .ssh/config sed -i 68d .ssh/config It was an eye-opening experience for me when I realized sed and ed commands are almost identical

It is the Stream EDitor after all.

Re: Ed is the standard text editor (2014)

#57
post #4

People make fun of ed, but the command line is basically ed with the ability to execute.

It is actually way more complex than that. Nowadays it doesn't get explained a lot anymore. Especially with every system coming with some fancy bash or zsh with somewhat sane defaults. But in the past you may have got just some naked Bourne Shell with no defaults at all. https://docstore.mik.ua/orelly/unix3/upt/ch30_14.htm explains a bit. They don't make books like this anymore. ;)

UNIX Power Tools defined, and largely proved the sole occupant, of a class of technical literature.

It's the single book that more than any had me finally grok Unix. I still have my copy, first edition, two-colour printing (blue for "hyperlinks" to related sections).

Jerry Peek is also an absolute treasure for Unix shell wisdom --- bash in particular though he's highly knowledgeable about others as well.

Re: Ed is the standard text editor (2014)

#58

There's no reason to use ed. It's a historical novelty at this point. Move on.

LPMUD's online editor comes with a reasonable implementation of ed. It's actually the only way to edit files in the MUD environment (and as a result, how I learned ed).

Ditto, learned ed and C that way. Tried again recently but quickly switched to editing files remotely.

Re: Ed is the standard text editor (2014)

#59
post #27

Perhaps it's better to see for a minute how people used this kind of editors when they first appeared, than to keep reading about them for ages: https://youtu.be/b6URa-PTqfA?t=100 (BBC from '79, mentioning how people start working from home with the aid of newfangled microcomputers and network connectivity). I'm reminded most of all of the fdisk util, where the workflow is pretty much the same: print, modify, print,…

That video is marvellous, when you compare it to today's technology and how it's used. The angsty "does it mean we'll all have to learn to type?", the female BASIC programmer working from home on her terminal with printer as a display. Great stuff.

Yeah, I'm kinda getting into these vids from the seventies and eighties.

“Introducing The Amazing Compact Disc, 1982” https://www.youtube.com/watch?v=_Tx6TYnPat8 — “You can pick it up and move around, even shake, and nothing happens”, yeah sure bud.

“Introduction to Microsoft Excel, 1992” https://www.youtube.com/watch?v=kOO31qFmi9A

“Susan Kare explains Macintosh UI ergonomics on the Computer Chronicles, 1984” https://www.youtube.com/watch?v=x_q50tvbQm4 — the control panel is just astounding by modern standards, especially seeing as for me the control panel is a litmus test of an OS interface.

Also one of my favorite music-making tutorials is the three-part, three-hour series ‘Intro to Synthesis’ from sometime in the early 80s: https://www.youtube.com/watch?v=atvtBE6t48M — instead of going through all the terminology in ten minutes and one second, the guy takes his time twiddling knobs and showing what each one does.

Re: Ed is the standard text editor (2014)

#60

I have written several scripts -- some throwaway, some not -- that use ed. If you know what you need to do to edit a file and need it automated, ed is just super handy. Here is a shell script that deletes all comments from a yaml file, then comments out a particular key: ed $file

In most cases I find `sed -i` to be more convenient than using ed in scripts, but the paradigm is a little different.

Except for when it breaks on FreeBSD or macOS. The most portable utility nowadays for desktop systems is ex, actually (because some Linux distros don’t include ed).
Post reply on HN