4 ms·
ed is still my daily driver when I need to edit stuff quickly, and here are a couple of reasons I'm keeping it in my toolbox: * Couple of KBs, you can't beat t
by dig1 6y ago
ed is still my daily driver when I need to edit stuff quickly, and here are a couple of reasons I'm keeping it in my toolbox:
* Couple of KBs, you can't beat that. You can put it almost everywhere.
* Runs with whatever terminal you have to use. Unknown or broken termcap, no problem. Even works inside Emacs eshell.
* Still unbeatable with terrible connections. Try that with vi/vim, and you'll cry, even without colors.
* Gives you "focused editing" without having to look at the whole file. Just like Ken Thompson said. For example, to read .bashrc ignoring comments, just use "g/^[^#]/n".
* The only editor you can easily script, the same way as you type in it. That is why we have "script" command.
* Very easy to print commands (as the author showed) and give students as "howto" to edit something. Easy to follow and no ambiguities.
- moonchild 6y ago> The only editor you can easily script, the same way as you type in it Easy enough to do with vim -c.
- deleted 6y ago[deleted]
- kovek 6y agoIt would be great if someone could demo their workflow with ed, to give people an idea of how it is. For now, I think I much prefer to see context lines when I’m editing
- Bluecobra 6y agoI use ed all the time when I need to quickly delete old SSH keys: # ssh foo Blah blah something nasty blah blah ssh rsa key known_hosts:29 # ed .ssh/known_hosts 123456 29d 123454 w q # ssh foo
- kwoff 6y agoFunny, I used to say the same thing about vi (I normally use emacs, but it was much quicker to open known_hosts with vim, type `29GddESC:wq!`). Though a few years ago ssh started to output a command to run, so I just copy-paste that now.