Is This Insane?
May 17, 2019
[ I’ve been very busy at work this week, and don’t have time to write a proper exercise. My apologies. ]
I stumbled across Twitter account ed1conf that included this method of collaborating with another user on an ed(1) session:
Have two ed(1) sessions open concurrently and want to easily transfer lines between them?
$ ed -p"a)" a.txt
in another shell
$ mkfifo fifo
$ ed -p"b)" b.txt
then
a) 15,21 w fifo
then
b) 13r fifo
Can reuse the same fifo bidirectionally. Finally
!rm fifo
I’m not sure if that’s brilliant or insane! Actually, I’m not even sure if a whole Twitter account devoted to ed(1) is brilliant or insane.
Perhaps you would like to share with us some other examples of brilliant insanity.
[…] 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 […]
The first thing I thought of was this blog post from 2007, Webserver in bash.
http://paulbuchheit.blogspot.com/2007/04/webserver-in-bash.html