The ed Video

After yesterday’s post on Thompson’s famous hack, I watched the video of Thompson’s talk at this year’s Southern California Linux Expo that Cox mentioned. That was pretty interesting as another example of Thompson’s curiosity and genius but the point for this post is that YouTube recommended a related video that turned out to be an Emacs Elements video on the ed editor. It covers most of what you need to know to use ed in real life. If you prefer a written tutorial, Brian Kernighan’s tutorial on ed is excellent and what I usually refer to when I forget something.

As I’ve written before, I use ed to edit my mbsync log file. I do this mainly to keep current on ed against the day I need it to recover a Unix or Linux box where nothing else works. With modern systems, that day probably won’t come but if it does, I’m prepared. In the meantime, I’m maintaining my connection with the old ways.

Emacs Elements says that he sometimes uses ed for short editing jobs and for scripts. You can see an example of scripting with ed in Cox’s post about the Thompson Hack. I like ed a lot but I can’t imagine using it as my regular—or even frequent—editor. Others disagree and do just that. It is, in any event, very useful for scripting and worth knowing for that alone. And for you Vi(m) users out there, almost everything in ed is available as a colon command so a knowledge of ed is especially useful for you.

This entry was posted in General and tagged , . Bookmark the permalink.