12 ms·
Ed is the standard text editor (2014)
- deleted 4y ago[deleted]
- snarfy 4y agoIf you use vi, you already know how to use ex.
- bombcar 4y agoPeople make fun of ed, but the command line is basically ed with the ability to execute.
- kstenerud 4y ago... which is what makes the command line so clunky and annoying.
- SPBS 4y agoThis enlightens me as to how people can code with ed (and why Ken Thompson famously said 'I don't want to see the state of the file when I'm editing.'). It's basically a REPL for writing code. Same as psql, the commands you use to view the state of the text (database) are different from the commands you use to edit the state of the text (database). Still sucks though. Even in psql I regularly drop into vim with \e to edit whole queries before sending them out.
- parasti 4y agoJust keep it in your head. ed must have been a decent upgrade from punched cards.
- rbanffy 4y agoAs a line editor, it’s pretty much editing a deck of punch cards. This metaphor, BTW, persists on a lot of mainframe related tasks where, while you see lines on a screen, the computer is reasoning about punch cards.
- omnibrain 4y agoIt is actually way more complex than that. Nowadays it doesn't get explained a lot anymore. Especially with every system coming with some fancy bash or zsh with somewhat sane defaults. But in the past you may have got just some naked Bourne Shell with no defaults at all. https://docstore.mik.ua/orelly/unix3/upt/ch30_14.htm https://docstore.mik.ua/orelly/unix3/upt/ch30_14.htm explains a bit. They don't make books like this anymore. ;)
- dredmorbius 4y agoUNIX Power Tools defined, and largely proved the sole occupant, of a class of technical literature. It's the single book that more than any had me finally grok Unix. I still have my copy, first edition, two-colour printing (blue for "hyperlinks" to related sections). Jerry Peek is also an absolute treasure for Unix shell wisdom --- bash in particular though he's highly knowledgeable about others as well.
- nescioquid 4y agoThat's a neat way to think of it. Coming from the other direction, for emacs users, using the command line is like using the editor since the gnu readline lib offers keyboard navigation like emacs.
- yakubin 4y agoExcept ^W performs a completely different action. I can't count the number of times after switching from a terminal to Emacs within a couple of seconds, my muscle memory still not updated, I hit ^W only to discover I've just deleted 3/4 of the file.
- cyberbanjo 4y agoYou know, I never put it into words myself, but me too. Here for us and others: (global-set-key "\C-w" 'backward-kill-word) (global-set-key "\C-x\C-k" 'kill-region) (global-set-key "\C-c\C-k" 'kill-region) ;; https://www.reddit.com/r/emacs/comments/5jbvc3/kill_is_now_cc_ck_instead_of_cw/
- larsbrinkhoff 4y agoThere is a solution to your problem: M-x shell
- workaccount21 4y ago?
- buescher 4y ago"Note the consistent user interface and error reportage."
- kabdib 4y agoI usually knew what I had done wrong. (Really). :-)
- Karellen 4y ago> Ken Thompson has an automobile which he helped design. Unlike most automobiles, it has neither speedometer, nor gas gauge, nor any of the other numerous idiot lights which plague the modern driver. Rather, if the driver makes a mistake, a giant “?” lights up in the center of the dashboard. “The experienced driver,” says Thompson, “will usually know what’s wrong.” -- The Unix Hater's Handbook pp. 57
- ashton314 4y agoNot a "viitor". Not a "emacsitor". Those aren't even WORDS!!!! ED! ED! ED IS THE STANDARD!!! TEXT EDITOR.
- davegauer 4y agoExactly. I assumed this would be a link to the glorious document https://www.gnu.org/fun/jokes/ed-msg.html https://www.gnu.org/fun/jokes/ed-msg.html I love reading C2, but anything in reference to ed(1) besides "Ed, man! !man ed" is wasting my VALUABLE time. :-)
- thematrixturtle 4y agoIt's reproduced verbatim lower down in the page.
- eropple 4y agoed checking in, can confirm. `The standard unix text editor` has been my Slack bio as long as I can remember for a reason.
- legalcorrection 4y agoThere's no reason to use ed. It's a historical novelty at this point. Move on.
- Koshkin 4y agoed is surprisingly usable (and useful, and fun to use), you should try it. > no reason This is like saying "There is no reason to use UNIX (now that we have Ubuntu, Gnome, and Wayland)." Personally, I tend to stick with the CLI for as long as it gets me where I need.
- Blackthorn 4y agoLPMUD's online editor comes with a reasonable implementation of ed. It's actually the only way to edit files in the MUD environment (and as a result, how I learned ed).
- totetsu 4y agoWasnt there a way to change your editor in discworld? Maybe they use very customized lpmud
- NoGravitas 4y agoDiscworld is a very customized lpmud, though there are other muds also based on Discworld's core code ("driver"). The default editor on Discworld wasn't ed, but a simpler, less-powerful line editor. ed was available as an option, though, last I checked (last time I logged in was when Pterry died, and then I hadn't logged in for years).
- macintux 4y agoDitto, learned ed and C that way. Tried again recently but quickly switched to editing files remotely.
- xenophonf 4y agoIt's a handy tool for scripting certain kinds of file editing operations. It's also good for editing files over remote management connections that don't implement a proper terminal interface. As with a lot of the Unix CLI, it may not be something you use frequently (or ever), but it's a godsend when you need it.
- ToddWBurgess 4y agoI used to know a BSD kernel developer who wrote all his kernel code with ed
- taylodl 4y agoThe last edit was in 2014? Who's worried about 2400 baud modems and terminals not having cursor positioning capabilities? It's 2022, not 1992! Is there some operating environment I'm not aware of?
- deleted 4y ago[deleted]
- daptaq 4y agoThis is a WikiWikiWeb article (https://en.wikipedia.org/wiki/WikiWikiWeb https://en.wikipedia.org/wiki/WikiWikiWeb), that has been running since 1995 and was frozen in 2014.
- sophacles 4y ago> Is there some operating environment I'm not aware of? The answer to this question is always yes. In this case for example: plenty of old control devices in industrial settings are still operating and use this bitrate.
- NoGravitas 4y agoI was perfectly happy using Emacs over a 2400 baud modem, on a fully-functional terminal (VT420 or Telix in DOS). But of course, Emacs' terminal display code is/was so heavily optimized as to be incomprehensible.
- PaulHoule 4y agoI remember using an ed clone with a TRS-80 Color Computer running the OS/9 operating system https://www.roug.org/soren/6809/os9sysprog.html https://www.roug.org/soren/6809/os9sysprog.html Previous to that I used the TECO editor on a PDP-11 https://en.wikipedia.org/wiki/TECO_(text_editor) https://en.wikipedia.org/wiki/TECO_(text_editor)
- djhaskin987 4y agoI have written several scripts -- some throwaway, some not -- that use ed. If you know what you need to do to edit a file and need it automated, ed is just super handy. Here is a shell script that deletes all comments from a yaml file, then comments out a particular key: ed $file << COMMANDS g/^#.\*$/d /yaml_key: s/^/#/ w q COMMANDS
- meatmanek 4y agoIn most cases I find `sed -i` to be more convenient than using ed in scripts, but the paradigm is a little different.
- jrumbut 4y agoI finally had an occasion to write a .sed script a few weeks ago and it was one of the highlights of my career.
- gnubison 4y agoExcept for when it breaks on FreeBSD or macOS. The most portable utility nowadays for desktop systems is ex, actually (because some Linux distros don’t include ed).
- marcosdumay 4y agoWell, of course, sed is not the stantard... It is still much more usable than ed. At least, it makes it easier to debug your script.
- gnubison 4y agoIn what way? Ed is interactive so you’d be able to act out your script line by line and check for mistakes, which seems easier to me. If you’re cognizant about the differences between ed and ex, you could even debug with vi.
- 4y ago
- russellbeattie 4y agoFor some reason it took me years to understand the need for a line editor. It didn't make any sense in my head. Then one day I saw the famous picture of Bill and Allen as kids in front of a teletype [1] and it finally clicked. The way it worked was like this: As you keyed in your program, letter by letter, it was printed out on the paper immediately like a typewriter. If you ran the program and there was a problem, you'd just read (or re-read) the printout, find the line with the bug, then use a line editor to fix just that line. You might mark the paper with pencil to keep track of the change. After a while if you needed to see the latest version, you'd just print the whole program out, or just the lines you needed. This realization finally clued me into what was going on when I was 10yo and programming BASIC on a TRS-80 Color Computer. It was essentially simulating a teletype (which makes sense given BASIC's inception at Dartmouth [2]), where you would type each line individually, then if there was a problem, you would edit the program individual lines at a time. I always thought it was an odd until I understood how actually using a teletype actually worked. Also explains why the command to write letters to the screen is called "PRINT". 1. https://www.gatesnotes.com/About-Bill-Gates/Early-Days-as-a-Computer-Programmer https://www.gatesnotes.com/About-Bill-Gates/Early-Days-as-a-... 2. https://youtu.be/WYPNjSoDrqw https://youtu.be/WYPNjSoDrqw
- projektfu 4y agoYeah, a lot of people would send their work to the line printer at the end of the day, and then start fresh the next day with a pencil to sketch out what they were going to change. Then using ed is a no-brainer. I heard that a lot of people preferred fewer files and longer functions for the same reason--it was all there on the fanfold output and could be read at once, rather than working in 80x25 chunks. After that mode of working was replaced by interactive programming at the display terminal, we started to prefer functions that didn't span more than 1-2 screens.
- IncRnd 4y agoThat's also why TTY is the name for abstract devices. Terminals are simulated teletypes.
- russellbeattie 4y ago
- aasasd 4y agoPerhaps it's better to see for a minute how people used this kind of editors when they first appeared, than to keep reading about them for ages: https://youtu.be/b6URa-PTqfA?t=100 https://youtu.be/b6URa-PTqfA?t=100 (BBC from '79, mentioning how people start working from home with the aid of newfangled microcomputers and network connectivity). I'm reminded most of all of the fdisk util, where the workflow is pretty much the same: print, modify, print, save. But also I can see where Vi/Vim come from, as I regularly do the same thing as in the vid: %s/something/something else/g and then wq.
- Joker_vD 4y agoI am sure anyone who worked with gdb without GUI/"dual" mode is aware of this experience.
- aasasd 4y agohttps://www.seekpng.com/png/detail/350-3502039_-name-stock-photo-no-thanks.png https://www.seekpng.com/png/detail/350-3502039_-name-stock-p...
- the_biot 4y agoThat video is marvellous, when you compare it to today's technology and how it's used. The angsty "does it mean we'll all have to learn to type?", the female BASIC programmer working from home on her terminal with printer as a display. Great stuff.
- aasasd 4y agoYeah, I'm kinda getting into these vids from the seventies and eighties. “Introducing The Amazing Compact Disc, 1982” https://www.youtube.com/watch?v=_Tx6TYnPat8 https://www.youtube.com/watch?v=_Tx6TYnPat8 — “You can pick it up and move around, even shake, and nothing happens”, yeah sure bud. “Introduction to Microsoft Excel, 1992” https://www.youtube.com/watch?v=kOO31qFmi9A https://www.youtube.com/watch?v=kOO31qFmi9A “Susan Kare explains Macintosh UI ergonomics on the Computer Chronicles, 1984” https://www.youtube.com/watch?v=x_q50tvbQm4 https://www.youtube.com/watch?v=x_q50tvbQm4 — the control panel is just astounding by modern standards, especially seeing as for me the control panel is a litmus test of an OS interface. Also one of my favorite music-making tutorials is the three-part, three-hour series ‘Intro to Synthesis’ from sometime in the early 80s: https://www.youtube.com/watch?v=atvtBE6t48M https://www.youtube.com/watch?v=atvtBE6t48M — instead of going through all the terminology in ten minutes and one second, the guy takes his time twiddling knobs and showing what each one does.
- layer8 4y agohttps://web.archive.org/web/20140516191215/http://c2.com/cgi/wiki/wiki?EdIsTheStandardTextEditor https://web.archive.org/web/20140516191215/http://c2.com/cgi... I still lament that the C2 wiki switched to JS rendering.
- Rochus 4y agoAha, is that the reason why I only see a spinning circle? I remember that I still could access it last year.
- evilotto 4y agoEvery link I click on opens up a new frame in the current window. Can't move them around, or focus, or anything. Whatever js rendering it is is either a bizarre design choice, or just plain broken.
- projektfu 4y agoI was never much of an ed user but I did a lot of stuff in EDLIN on PC DOS 3.1. Ed seems a little more powerful and useful. With 512K of RAM on a 6MHz 80286, using an editor that fit into one "segment" and loaded quickly from a floppy was nice. The original DOS 1.0 edlin was just over 2K. Of course, we had printed manuals back then, and you could learn EDLIN with the manual on your lap while you typed commands.
- shadowofneptune 4y agoI tried out programming in DOS using tools of the period, and I found edlin surprisingly easy to use; easier to get into than ed. It did have a few quirks. It uses the ASCII SUB character, ^Z, to separate the fields of a substitution command. That does eliminate escaping issues at least.
- scotty79 4y agoI always default to mcedit. I can't shake off being raised in Norton Commander in primary school.
- simonh 4y agoWhen I started working on Sun systems back in 1991 the first terminal I used was an old model that didn't support all the cursor controls, so my only option for editing was ed. I worked that way for a year, so for a long time I was more comfortable in ed than vi. Of course on most systems nowadays ed and vi are now different modes of the same editor, as the article notes.
- einzelganger 4y agoI find ed to be the perfect program to test a new programming language. It demands good support for strings, regexes and data structures while being reasonably sized to be completed in under a week. I polished my C skills as I was learning it by writing this from scratch[1]. [1] Shameless plug, here it is: https://github.com/bojle/edd https://github.com/bojle/edd
- kqr 4y agoThis could be an interesting challenge: speedrun up to full ed from just cat/tail/echo/head, shell redirects, and compiler of your choice.
- fastaguy88 4y agoI hate to be that guy, but 'ed' is very unix specific. In the mid-1970's (and apparently as early as the 1960's according to Wikipedia), those of us on TOPS/10, TOPS/20 (and perhaps other DEC systems) were using TECO (which of course became EMACS).
- drivers99 4y agoEDLIN in MS-DOS was very similar to ed. (Here's a short third-party manual that someone wrote. http://www.sqrt-pi.org/boots/Done-That/Edlin-manual/p11.html http://www.sqrt-pi.org/boots/Done-That/Edlin-manual/p11.html )
- dboreham 4y agoEarly MS was heavily dec-10 based, wasn't it? so it's possible its lineage comes through TECO, via CP/M ED.
- jhallenworld 4y agoYeah, also for PDP-8s and PDP-11s, which were very popular at the time. TECO-like editors are interesting to use: Unlike line editors (like ex/ed/edlin, etc.), the edit position can be anywhere, not just at line boundaries. But there is no screen, so you really need a good imagination to keep track of this.. Also, they can edit files larger than can fit in the edit buffer, but not in the way this works on modern editors, where the editor manages everything. Instead, the editor makes one pass through the large file, copying it from input to output. You get to make changes along the way, in the part of it that fits in the edit buffer. TECO has a page concept to help with this: you break your large file into pages separated with form feeds, and there are commands to retrieve the next page from the input file and write the old page to the output file. But I've seen TECO clones without the page concept on early micros. Vestiges of this page concept remain in emacs to this day..
- rhabarba 4y agoAlso, several versions of TECO (like TECOC and the Scintilla-based SciTECO) are still in active development. :-)
- johncoltrane 4y agoEd doubters might find this episode of Lambda Island enlightening (and fun): https://lambdaisland.com/episodes/ultimate-dev-setup https://lambdaisland.com/episodes/ultimate-dev-setup
- aatharuv 4y agoThe humorous part of this is from 1991. https://www.gnu.org/fun/jokes/ed-msg.html https://www.gnu.org/fun/jokes/ed-msg.html
- marttt 4y agoSee also: Rob Pike's sam editor for Plan 9: http://sam.cat-v.org/ http://sam.cat-v.org/ Less commands and a language where "everything is a (huge) string". So its operations are not limited to lines like in ed. A tutorial of the command language: http://doc.cat-v.org/bell_labs/sam_lang_tutorial/sam_tut.pdf http://doc.cat-v.org/bell_labs/sam_lang_tutorial/sam_tut.pdf And Pike's introductory paper: http://doc.cat-v.org/plan_9/4th_edition/papers/sam/ http://doc.cat-v.org/plan_9/4th_edition/papers/sam/ All in all, the terseness of the language can be quite addictive. :) http://sam.cat-v.org/cheatsheet/ http://sam.cat-v.org/cheatsheet/
- unrznbl 4y agoI use ed for pretty much all editing. Have for a few years after I got tired of trying to debug emacs/org mode :) YMMV of course. :) And so I have learned bash/shell better because of it which I am thankful for.
- dang 4y agoRelated: “Ed is the standard text editor.” (1991) - https://news.ycombinator.com/item?id=14406846 https://news.ycombinator.com/item?id=14406846 - May 2017 (8 comments) Ed is the standard text editor (1991) - https://news.ycombinator.com/item?id=9936980 https://news.ycombinator.com/item?id=9936980 - July 2015 (3 comments) Lots more: https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=%22Ed%20is%20the%20standard%20text%20editor%22&sort=byDate&type=comment https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
- hestefisk 4y agoThis, alongside BOFH, is worth its weight in gold in terms of humour. I can also recommend reading the jargon file by ESR to really tap 80ies / 90ies hacker culture.
- dboreham 4y agoI'm still using it almost daily, since 1980, although I suppose today it's an emulation inside vim not the real thing. Not used for my code IDE or anything, but little config files etc. We had vi on our '11 in 1980 but I could never get along with it and still can't. Source if anyone's interested. 1700 loc : https://github.com/v7unix/v7unix/blob/master/v7/usr/src/cmd/ed.c https://github.com/v7unix/v7unix/blob/master/v7/usr/src/cmd/...
- deleted 4y ago[deleted]
- jasonm23 4y agoMy absolute favorite remedy for social media addiction. Read entries from c2 wiki. Don't know what to do with yourself for a few minutes DO NOT open Reddit, Facebook, Instagram, TikTok, Twitter ... Whatever. Read the original, classic group discussion on tech. With Ward Cunningham, Kent Beck, Rob Pike, and many many other luminaries contributing to this endless discussion, you cannot fail to be educated on some level. So before you read another random article here, on medium or some other place where a "10x" dev just learned something about X ... Just don't, go read c2 wiki.