6 ms·
ed(1) mastery is a must for a real Unix person
- baz00 3y agoI think this is the worst straw man headline I've ever heard. I've never actually used ed once in the last 30 years of using Unixes both on a programming and admin perspective. Edit: ok he got me :)
- HankB99 3y agoMany long years ago I took a course that required using a terminal to edit and run code (Language was Dartmouth Basic.) One lucky student got to use a full screen terminal while the rest of us used some kind of line oriented terminal. My recollection is the DEC LA120 (Though this was on a Prime 300 mini.) The only way to edit code was using a line oriented editor. (Though not technically ed on UNIX.) We have come so far since.
- jimmaswell 3y agoI've been using Ed to write assembly on my Kaypro since it's so much faster than WordStar. It's been interesting seeing how people used to do it.
- tux1968 3y agoFor those who don't notice straight away, the date on the article is April 1st.
- madamelic 3y agoOk, good. I was so confused. I thought this was like nerd supremacy but it does ring true: your text editor doesn't matter, you are not a better writer / programmer / person because of what editor you use. I did thoroughly enjoy the dig about BSD supremacy. Those guys are worse than vegans and environmentalists. :)
- heyoni 3y agoYea like what's a fake unix person like?
- bluetomcat 3y agoSomeone using WSL 2 on Windows 11, or a macOS user who only knows how to type "ls" in their terminal :-)
- RichardCA 3y agoAnyone who didn't start during the CRT era, when you couldn't even count on curses support in the terminal. The "everything is a printer" abstraction started because PDP's that ran V7 Unix at Bell Labs really did use Teletypes for user interaction. https://en.wikipedia.org/wiki/Teleprinter https://en.wikipedia.org/wiki/Teleprinter
- foobarian 3y agoI mostly agree, however it seems that a certain core of editor controls has managed to spread and become a commonly available default in various products. The emacs shortcuts in particular seem to be available any place there is a text editor box like in browsers, in web IDEs, mainstream IDEs like VSCode or IntelliJ etc etc and as such I think it makes good sense to learn those just as a matter of education.
- sproingie 3y agoEmacs keybindings are even baked into NSText, the basis of everything to do with text handling in macOS.
- hollerith 3y agoA bit of an exaggeration because VSCode (on macOS or any other OS) for example does not recognize any Emacs keybindings. Ditto textareas in Chrome and Firefox.
- SllX 3y ago
- airstrike 3y agowhich seems silly given today is December 15.....
- elteto 3y agoI transpiled ed’s C code to Javascript so I could run it with node.js. Now I can finally run ed under Windows and replace notepad.exe.
- DiggyJohnson 3y agoThat is awesome. This might be my weekend project to do something similar.
- thaumasiotes 3y agocompile to Jscript instead and you won't need node.js.
- yetanotherloss 3y agoWindows notepad possibly being the most prominent text editor that ed is unambiguously superior to. Still blows my mind that projects like notepad++ have been around for the literal lifetime of younger users and somehow MS just did not give any sort of shit about their terrible editor.
- loloquwowndueo 3y ago“Notepad.exe too crappy for you? Buy Word!” This is why.
- mauvehaus 3y agoWord is a replacement for notepad like a chainsaw is a replacement for a pair of dressmaker's shears. They do superficially similar jobs, but the similarities end the first time you try to use one for a job that requires the other.
- michaelmrose 3y agoIt's purpose is be able to open a text file and encourage you to buy word and visual studio. A user who has an grade F and many grade A and B options may not be better off if upgraded to a default D or C. In fact if they don't move on to one of the A options they may be worse off.
- jvns 3y agoThat book (Ed Mastery, https://mwl.io/nonfiction/tools#ed https://mwl.io/nonfiction/tools#ed) is an April fool's joke, but it's a real book and I thought it was actually really good. I've still basically never used ed but it was fun to learn about and it helped me understand vim's history a little bit.
- bewuethr 3y agoMy favourite part about it is the "Manly McManface Edition" with masculine pronouns for double the price :D https://www.tiltedwindmillpress.com/product/manly/ https://www.tiltedwindmillpress.com/product/manly/
- cylinder714 3y agoIt has a prettier cover, too.
- denton-scratch 3y agoI did use ed, ever so briefly. I was introduced to it when my employer brought-out a new machine that ran SVID. We talked to it through glass teletypes. The commands in vi are based around the commands in ed. They belong to the same family. sed is also a family-member, and an amazing tool. But I won't be sorry if I never run into ed again. Essentially, it's a rudimentary editor with zero dependencies; it doesn't need a curses library, in particular. And it would work on a terminal with only a printer for output, which was useful, back then.
- GauntletWizard 3y agoI still use ed - Ed formatted patches are great for retro computing, I would very rarely use it interactively, but scripting with it is surprisingly useful.
- bch 3y agoI’ve used ed scripting in serious production work across thousands of hosts. It was nice to have that programmability but be able to “reason” with the entire file.
- buescher 3y agoKernighan and Ritchie wrote the 1st edition of their book with ed and troff, didn't they?
- MarkusWandel 3y agoArguably, 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!
- sebtron 3y agoReminds me of the classic "Ed, man! !man ed" https://www.gnu.org/fun/jokes/ed-msg.html https://www.gnu.org/fun/jokes/ed-msg.html
- cratermoon 3y agoED IS THE STANDARD!!! TEXT EDITOR.
- rf15 3y agoEd is the standard text editor, after all.
- bananaflag 3y agoThere is also Edlin https://en.m.wikipedia.org/wiki/Edlin https://en.m.wikipedia.org/wiki/Edlin
- kstenerud 3y ago> Your choice of text editor is a serious matter. No, it's not. It really doesn't matter at all what editor you use. And there are so many to choose from. You don't even need to stick to only one editor. I sure as hell don't. Editor loyalty is tribalism, and tribalism is myopic. Use whatever tool gets the damn job done, and learn a few of them so that you at least know what's possible.
- j4yav 3y agoWhat you're saying is true, but for context the article is an old April fool's joke. Not sure why it was posted today.
- ska 3y agocheck the publication date.
- bluGill 3y agoEditor loyalty is more than tribalism. The more/better you know your editor, the quicker you can make some complex edits of the type that editor enables. Of course some editors are more limiting than others, so you can master notepad in an a short time - though it probably isn't worth the bother even though it can insert the date/time into your document (as I just discovered while writing this), the limited functions means if you need that feature you should already be using a different editor that provides other features it doesn't. However be careful. Editors do offer different features. Some things really are easier/better in a different editor, thus even after you settled on an editor you should - every few years - take a look around to see if maybe something else is enough better in some way as to be worth learning in depth. While sometimes it seems like the wrong choice will get the other tribe to kill you (or condemn you to hell for eternity), I'm not aware of that ever happening - generally you can remain friends with other people after switching.
- frankjr 3y agoFor those curious how it actually looks like when a skilled person uses it: https://www.youtube.com/watch?v=BNYpmLH6IjQ https://www.youtube.com/watch?v=BNYpmLH6IjQ
- bregma 3y agoAs an undergraduate we had to use ed for all our editing needs after we moved away from punch cards because vi was considered too resource-hungry. Four years of ed on an IBM 3101, and to this day 4 decades later I still prefer a green-on-black CLI interface and Cherry MX Green keys but use vim in big windows. I can still get by using ed when I have to though.
- hondo77 3y ago[2018]
- gumby 3y agoIf you know vi, you pretty much know ed, as this jokey article glancingly points out. There is a bug in the article: i" vi(1) does offer a distinctly visual interface that only became possible with the advent of the video terminal, affectionately known as the glass teletype." The term "glass teletype" was coined specifically once there were terminals with addressable displays (that is, your program could place a character at any character position on the display at location X,Y). Until then displays drew at the bottom of the screen and scrolled the entire display upwards when receiving a line feed. Basically like a teletype! The blog author has a white beard so could potentially be old enough to remember those days, but also is in Norway so the slang could have been shorn of its roots in the process of crossing the Atlantic.
- bluGill 3y agoNot just teletypes. Most BBS systems (1980s) didn't have a good way to control the remote screen and so they ended up acting like they were printing to paper despite having a full terminal on the other end. I did use a teletype in the early 1990s to call a BBS (via acoustic coupler) - when lightening took out my computer. Other than the waste of paper is worked just fine. Unfortunately none of them provided an editor near as good as ed - but as a kid I didn't know what I was missing. I've also had to configure equipment that only provided a serial port. Some let me configure TERM, but others did not. Either way I knew ed and so figuring out how to configure TERM wasn't worth the bother for quick changes. Even in the late 1990s, computers were sometimes slow enough that for quick changes I could open ed and make the change faster than vi could load. Don't get me started on loading emacs on those (which most people did and probably why ed was faster)
- cybrexalpha 3y agoI understand this is an April Fool's joke and is intended to be satire, but I don't think that's made clear enough in the text. There's risk that a junior engineer or student reading this will misunderstand it as sincere, and be dissuaded from technical work altogether. Make no mistake, there are plenty of people in our industry who hold genuine opinions like this and are more than happy to bash less experienced people for trivial tool choices.
- fragmede 3y agoPoe's law strikes again! That risk is real, but a student who isn't open enough to express that they read this to their professor and classmates, and that they read it seriously, is likely to have problems in other fields as well.
- tambourine_man 3y agoThere are many text editors but only one standard.
- seanhunter 3y agoed is useful in one specific circumstance, but it's useful enough in that circumstance that I recommend it to anyone who's really serious about unix shell scripting. In the context of a shell script, there are things you can do with ed and a here document that are extremely difficult to do any other way. For example, I had to recover my website from the wayback machine during covid lockdown (long story). I decided to change everything to markdown and wanted to add yaml frontmatter to every one of a hundred or so markdown files. The Yaml frontmatter needed to be different for each file and I ended up having to make various tweaks before I brought it back live. So, ... multiple times I had to do edits like "in the fourth line above the -- that ends the yaml front matter, change x to y". This is a very tough edit to make with the usual suspects (sed/perl/awk etc), but is a breeze to do if you run ed in your shell script and have the commands you want to run supplied by a here doc.
- 1vuio0pswjnm7 3y agoI still use for ed non-interactively moving and deleting lines in large text files, e.g., lists, and have not come across anything that I think is better. I use sed for non-interactve editing as well. Below is a favourite of script of mine ("ins") that I use frequently for non-interactively inserting text at the top or at any line in text files. #!/bin/sh case $# in :) ;;0) exec echo usage: ${0##*/} target \[line-no\] ;;[12]) sed -i -e ${2-1}r/dev/stdin -e1N $1 esac Stupid examples: echo 93.184.216.34 example.com|ins /etc/hosts cat 84*.c|ins 084.l 151 # insert some .c files at line 151