7 ms·
There's something mildly charming about fixes to ed(1) in software released today. > Fixed ed(1) to print bytes read/written and the ? prompt to stdout, not st
by higherhalf 3y ago
There's something mildly charming about fixes to ed(1) in software released today.
> Fixed ed(1) to print bytes read/written and the ? prompt to stdout, not stderr.
- hestefisk 3y agoed is still the standard editor.
- VWWHFSfQ 3y agowhat do you mean by standard editor
- mstevens 3y agoProbably a reference to https://www.gnu.org/fun/jokes/ed-msg.html https://www.gnu.org/fun/jokes/ed-msg.html
- mrweasel 3y agoThe POSIX standard defines ed as one of the editors that must be present for a system to be standard complaint, the other being vi I believe. You can always expect ed to be available to you on a Unix system.
- doubled112 3y agoThis was initially why I learned enough of the vi keybinds to get by. You can expect it to be there.
- znpy 3y agoYou can expect that on a unix system that has applied, paid and received the unix certification. Most linux distros (and most BSDs afaik) are not unix certified. MacOS is, for that matter.
- zinekeller 3y agoPOSIX != Unix (the certification) It is true that all certified Unix systems follows POSIX, but it doesn't mean that non-certified systems are forbidden to follow POSIX. Most Linux distributions have ways to turn to 98% compliant, and BSDs have always strive to follow POSIX. Weird fact: POSIX was actually named by RMS.
- chungy 3y agoOpenBSD was fairly anti-POSIX in the past. I don't know if that's relaxed at all, but they very much do not chase after it.
- krylon 3y agoBut they do have ed, vi (plus ex), and mg (which is not standard but nice to have) in their base system.
- chungy 3y agoTwo of those programs predate POSIX and do not indicate that OpenBSD follows POSIX. They are making their operating system to the design they like best. Some of it happens to coincide with what POSIX asks for, but it is merely coincidental.
- krylon 3y agoI vaguely recall some interview with or blog post / talk by an OpenBSD developer, where they said that POSIX tended towards adopting whatever GNU/Linux did, and that the BSD crowd's interests were not taken into consideration that much. I don't know much about the process behind POSIX/SUS, but I can understand how OpenBSD developers wouldn't be super enthusiastic about POSIX compliance if they felt their input was falling on deaf ears. FWIW, I did use the SUS as my main reference when writing a few hobby projects, and OpenBSD gave me no problems whatsoever. macOS, on the other hand, which is a certified Unix, did not support barriers at the time (that was ~10 years ago, I have no idea if Apple added support since). (I know barriers are optional, but come on.)
- zinekeller 3y agoed: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/ed.html https://pubs.opengroup.org/onlinepubs/9699919799.2018edition... vi: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/vi.html https://pubs.opengroup.org/onlinepubs/9699919799.2018edition...
- chasil 3y agoYou can see all of the utilities this way. The ex editor is also standard. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ https://pubs.opengroup.org/onlinepubs/9699919799/utilities/
- madars 3y agoTIL: busybox has ed and vi but not ex. https://www.busybox.net/downloads/BusyBox.html https://www.busybox.net/downloads/BusyBox.html (so ex might be nice to learn but it might be not available on common systems like OpenWRT)
- wahern 3y agoTechnically, vi and ex are part of the User Portability Utilities extension.
- 64operator 3y agoEven DOS and VMS had ed, I'm sure other OSs too.
- deleted 3y ago[deleted]
- adl 3y agoHere: https://www.gnu.org/fun/jokes/ed-msg.en.html https://www.gnu.org/fun/jokes/ed-msg.en.html
- cperciva 3y agoAnd there's even a book about it, in case anyone has trouble figuring out how to use ed: https://www.tiltedwindmillpress.com/product/ed/ https://www.tiltedwindmillpress.com/product/ed/
- codetrotter 3y agoLove the books by mwl. Have physical copies of several of them, and the whole bunch of the ebook versions. Currently reading one of the physical copies. The one about Ed I have in ebook format only and didn’t read it yet. Will get to that one after I finish reading the physical books that I have from him.
- nixcraft 3y agoIn the old days, Unix rescue boot floppy disk to fix workstations or servers only included minimal text editors such as ed (i think vi was added later). So if you were a Unix admin or power user, you need to know ed to fix the dam system. The 'ed' text editor was available everywhere. These days rescue disks boot from USB or CD/DVD-ROM and may have a full desktops or operating systems running. A little bit of history, I guess. BTW, I prefer https://www.system-rescue.org/ https://www.system-rescue.org/ these days to fix Linux bare metals.
- kjs3 3y agoPerhaps more important, as a line editor, 'ed' would often work when your terminal was otherwise too borked up for vi or pico to work.
- anyfoo 3y agoThough in most cases, you can just type “reset” to reset your terminal to a sane state. If the problem is not the terminal’s state, but how software is trying to talk to it, setting TERM=vt100 (with a “reset” for good measure afterwards) usually works for most if not all terminals nowadays.
- kjs3 3y agoI used 'stty sane' or mucked with 'tset' directly. To many possibilities of 'reset' being aliased to something I might not want. setting TERM=vt100 (with a “reset” for good measure afterwards) usually works for most if not all terminals nowadays Kids these days and their 'everything is a vt100'. Perhaps true nowadays, but certainly not always (looks at his HP700/96).
- vbezhenar 3y agoLast time I checked, OpenBSD installer didn't have any editors but ed.
- cylinder714 3y ago