Collaboration in ed(1)

As some of you know, I satisfy my retro-computing itch by occasionally firing up ed for a simple editing task. In truth, I do it mainly to stay current with ed against the day that I need it. That and the fact that it’s fun even if I wouldn’t want to use it as my main editor.

This week, the proprietor of Programming Praxis didn’t have time to come up with a real programming exercise so he shared what he described as an insane example of collaboration using ed. Actually, it’s not really “collaboration” but a way of sending some lines in one ed session to another. There is, of course, no built-in way of doing that in ed but the originator of the idea came up with an amusing solution.

I’ll let you go over to Programming Praxis to see how it’s done. Just to make things clear, the idea is to send lines 15–21 from session a) to session b) and have them inserted after line 13 in session b). If you’re familiar with Vi/Vim, you’ll have no trouble understanding what’s going on. Don’t worry about the -p in the ed invocations; that’s just to set the prompt to make it easier to follow what happens during the “collaboration.” None of this has any import at all, of course, but it is an amusing diversion on a lazy Sunday afternoon.

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