4 ms·
Arguably, interactive editing with "ed" is an obsolete skill that went out with 110baud mechanical teletypes. However, having a basic idea of "sed" is a goldmi
by MarkusWandel 3y ago
Arguably, interactive editing with "ed" is an obsolete skill that went out with 110baud mechanical teletypes.
However, having a basic idea of "sed" is a goldmine for super-quick command line pipeline kinds of tricks. Even in this day and age.
- omoikane 3y agoed is still great if I just want to fix a few lines remotely over a terminal. You might say ed is interactive sed :)
- bee_rider 3y agosed and vi both have roots in ed, right? So you only needed one more round of advancement from ed to reach peak computing. I mean we’re all joking in this thread to some extent, but actually, I don’t know that I don’t believe this.
- alchemist1e9 3y agoIronically I’m studying all the oldest of oldest UNIX utilities that can work well over a pure teletype style terminal, think a LA34 DECwriter IV. No ncurses, no TUI. only line feeds and also ink is scarce. Why? Because we have a new friend in the house who effectively has to interact with the outside world via teletype terminal. The LLMs!
- bodyfour 3y agoA great point, but even over a teletype you'd use "ex", not "ed".
- alchemist1e9 3y agoTotally true! Thank you for reminding me of ex.
- chefandy 3y agoCurious: Why would you use ed over ex, or vi for that matter?
- omoikane 3y ago"ed" is easier to type than "ex" but mostly it's a matter of habit. On some systems, /bin/ed is a separate binary but /usr/bin/ex is actually just a symlink to vim, and at that point I might as well run vim. As to why I run "ed" instead of "vi": if I get just a few errors from some script I just copied over, I could run "ed" and the error message is still on the screen (because ed doesn't repaint the whole screen). I would run vi and screen if I expect to fix more than just a few lines.
- chefandy 3y agomakes sense
- Voultapher 3y agoPSA if you use sed with anything but trivial patterns, consider supplying the pattern via file `sed -f script.sed`. Saves you a lot of sanity not having to escape everything in arcane shell + regex escape rules.
- bodyfour 3y agoIt remained a valuable skill into the 1990s when many UNIX machines still had a separate /usr partition. Many times I'd have to fix a server with a configuration issue causing /usr to not mount correctly on boot. When you're at a single-user shell and no /usr/bin/vi is available suddenly knowing the basics of /bin/ed becomes very useful. Of course these days most UNIXes moved away from a separate /usr partition so if the root filesystem mounts you have a full-featured vim.
- macintux 3y agoed also was, at least on LPMuds in the 90s, the only online editor. It was a bit crippled, but still recognizably ed.
- medoc 3y agoI used ed on video terminals connected to VME 68000 Unix V7 machines around 1986. For some reason, I don't remember using vi on them, and in any case, ed remained very useful when the terminal type was misconfigured or unknown to the system, which happened quite a lot (I guess that not everything emulated a VT100 at the time). We actually jumped directly from ed to some Emacs relative (Jove probably), which was the beginning of paradise, and then we received our Sun 3 and it was Emacs all the way to present :)
- cylinder714 3y agovi is painful over slow lines, maybe that was it? When I started at SCO in '86 my terminal connected at 9600 baud to a VME 68000 box named "scotty" running Xenix. (All our servers had names containing "sco". Over the years I think we had to settle for just having the letters somewhere in the name.) 9600 baud was luxury after university, where all our terminals connected at 2400 baud.