Actually using Ed
blog.sanctum.geek.nz
Actually using Ed
1–10 of 92 posts
Re: Actually using Ed
#2Re: Actually using Ed
#3That was a good explanation. I hope never to have to use ed.
Re: Actually using Ed
#4Re: Actually using Ed
#5Though, you could instead just redirect cat to a file and then do any tidy-up in your usual editor.
It's also sometimes useful when you're in a remote system that is behaving strangely due to screwed-up terminal definitions or some other catastrophe.
I'd be interested to read a sam tutorial focussed on using just the console version of the tool (i.e. not using the windowing system). I understand it takes a lot of ed's features and beefs them up.
Re: Actually using Ed
#6"Well, it's terse, but let's see if we can't make it laconic"
Re: Actually using Ed
#7I use ed frequently for writing quick scripts. Its edge is that you can use it while retaining visual history of the prompt. Though, you could instead just redirect cat to a file and then do any tidy-up in your usual editor. It's also sometimes useful when you're in a remote system that is behaving strangely due to screwed-up terminal definitions or some other catastrophe. I'd be interested to read a sam tutorial foc…
Re: Actually using Ed
#8I use ed frequently for writing quick scripts. Its edge is that you can use it while retaining visual history of the prompt. Though, you could instead just redirect cat to a file and then do any tidy-up in your usual editor. It's also sometimes useful when you're in a remote system that is behaving strangely due to screwed-up terminal definitions or some other catastrophe. I'd be interested to read a sam tutorial foc…
http://doc.cat-v.org/bell_labs/sam_lang_tutorial/
A cool thing about sam is that it has a client-server design, so you can run the GUI on your local system and still edit stuff remotely. This works very well even over very high latency connections.
See the -r flag: http://man.cat-v.org/p9p/1/sam
I still use ed for any short/small edits, it is hard to beat.
It works even better if you have a terminal like in rio/9term where you can edit/send history very easily.
cat also works quite well in such terminals thanks to 'hold mode' (cat > foo, press Esc, edit your text freely, press Esc again and ^D).
Re: Actually using Ed
#9That was a good explanation. I hope never to have to use ed.
So it may sound crazy that you have all of these terse commands, but just imagine that you're trying to write a one-line program to reformat text documents and it suddenly makes a bit more sense.
Re: Actually using Ed
#10 If you’re using any Unix at all, then ed really will always be there,
no matter how old or limited the system.
So as it turns out, my Arch Linux setup does not actually have ed.