Earlier quoted context omitted.
On many systems you should be able to unbork the terminal with 'reset' or 'tput reset'. Then you do not need ed ;)
That's only going to fix a few causes of borked-ness. If the remote system doesn't have a termcap for your terminal, reset doesn't do much. In that case, setting TERM=vt100 will probably help matters, unless you're on a really obscure terminal of some sort.
Actually using Ed
61–70 of 92 posts
Re: Actually using Ed
#62Re: Actually using Ed
#63I'm glad ed is there. I'm glad articles like this are there. But there is no way I'll have retained that article in the moment my terminal has borked and I actually need ed. I wish that something like this available in the man pages, or something like them, or at least referred to in them. Because maybe I'm not clever enough but I don't find the man page articles to be very good introductions. As reminders of syntax…
Linux man pages are notoriously verbose, and often obtuse and incomplete, this is in great part due to the extra complexity of GNU tools and their preference for the infamous info documentation system. OpenBSD has probably the best Unix manual pages: http://www.openbsd.org/cgi-bin/man.cgi?query=ed And Plan 9 has a manual that is a pleasure to read, this is helped in part because the commands themselves have been clea…
Re: Actually using Ed
#64I used to work at a place where their mission critical software was running on ancient HP-UX boxes which we feared to turn off because we didn't know if they would turn back on. My job was to port this software to modern Ubuntu VMs. Once I was done, we had a celebration in which we turned off the HP-UX boxes forever... except of course there was a bug in my version, so we soon had to turn them back on while I worked…
Re: Actually using Ed
#65Earlier quoted context omitted.
It is a very sad and distressing trend that some Linux distros don't include ed in their base systems. Ed is as essential to a Unix system as cat or grep.
Why? We have better alternatives, and clearly things can work without it.
Re: Actually using Ed
#66Having been a user of *NIX for over 20 years and a professional Systems Administrator for over 10, I have never once had a reason to use ed. Even the smallest embedded environments usually have some variant of vi available. The only time that I've needed to use ed was edlin in the dark days of early MS-DOS, which is very similar. This is borderline masochistic.
Re: Actually using Ed
#67I'm glad ed is there. I'm glad articles like this are there. But there is no way I'll have retained that article in the moment my terminal has borked and I actually need ed. I wish that something like this available in the man pages, or something like them, or at least referred to in them. Because maybe I'm not clever enough but I don't find the man page articles to be very good introductions. As reminders of syntax…
Re: Actually using Ed
#68Earlier quoted context omitted.
Linux man pages are notoriously verbose, and often obtuse and incomplete, this is in great part due to the extra complexity of GNU tools and their preference for the infamous info documentation system. OpenBSD has probably the best Unix manual pages: http://www.openbsd.org/cgi-bin/man.cgi?query=ed And Plan 9 has a manual that is a pleasure to read, this is helped in part because the commands themselves have been clea…
I think instead of `verbose' you meant the opposite `terse.'
Re: Actually using Ed
#69I'm glad ed is there. I'm glad articles like this are there. But there is no way I'll have retained that article in the moment my terminal has borked and I actually need ed. I wish that something like this available in the man pages, or something like them, or at least referred to in them. Because maybe I'm not clever enough but I don't find the man page articles to be very good introductions. As reminders of syntax…
Info pages are utterly useless--I don't think I've ever had anything useful from there. If I've screwed my system up so badly I need to use ed, even "man" might not necessarily work (these days GNU commands are just so damn clever). Best thing is usually to grab another computer or your smartphone and start Googling.
Re: Actually using Ed
#70 http://www.tuhs.org/Archive/PDP-11/Trees/V6/usr/source/s1/ed.c
1333 lines of C, basically no library use at all (no printf, not even malloc -- the only thing dynamically allocated is the document, and it uses sbrk() to manage the memory itself), compiles down to about 6K on a PDP-11. And that includes a regex engine!It contains a lot of 1970 C-isms that won't work today ("=+" instead of "+=" for example) but an experienced C programmer shouldn't have a hard time following it.
As a bonus, look at the commented-out getpid() implementation at the bottom of the file.