←back to thread

414 points henry_flower | 1 comments | | HN request time: 0.202s | source
Show context
dataf3l ◴[] No.43108825[source]
I love this!

first time I see people use 'ed' for work!!!

I wonder who else has to deal with ed also... recently I had to connect to an ancient system where vi was not available, I had to write my own editor, so whoever needs an editor for an ancient system, ping me (it is not too fancy).

amazing work by the creators of this software and by the researchers, you have my full respect guys. those are the real engineers!

replies(12): >>43109010 #>>43109194 #>>43109301 #>>43109539 #>>43110057 #>>43110469 #>>43110822 #>>43111484 #>>43112586 #>>43113964 #>>43114110 #>>43115284 #
1. ajross ◴[] No.43109010[source]
Interestingly it's actually a sort of degenerate use of ed. All it does is append one line to an empty buffer and write it to "hello.c". It's literally the equivalent of

    echo 'int main(void) { printf("hello!\n"); }' > hello.c
...EXCEPT...

It's not, because the shell redirection operators didn't exist yet at this point in time. Maybe (or maybe not?) it would work to cat to the file from stdin and send a Ctrl-D down the line to close the descriptor. But even that might have been present yet. Unix didn't really "look like Unix" until v7, which introduced the Bourne shell and most of the shell environment we know today.