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,…
Ed is the standard text editor (2014)
51–60 of 125 posts
Re: Ed is the standard text editor (2014)
#52I 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.
Re: Ed is the standard text editor (2014)
#53People 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…
Re: Ed is the standard text editor (2014)
#54https://web.archive.org/web/20140516191215/http://c2.com/cgi... I still lament that the C2 wiki switched to JS rendering.
Re: Ed is the standard text editor (2014)
#55?
-- The Unix Hater's Handbook pp. 57
Re: Ed is the standard text editor (2014)
#56Earlier 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
Re: Ed is the standard text editor (2014)
#57People 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. ;)
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)
#58There'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).
Re: Ed is the standard text editor (2014)
#59Perhaps 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.
“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)
#60I 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.