Live data from Hacker News

Become Shell Literate

drewdevault.com

271–280 of 341 posts

Re: Become Shell Literate

#271
post #235

Earlier quoted context omitted.

> The Linux man pages are upside down. Examples don't come till the very end, if at all. man pages are meant to be a full reference, not a quick tutorial. To get the quick tutorial others have already mentioned cheat.sh [1] and tldr pages [2] is another good resource. [1]: https://cheat.sh/ [2]: https://tldr.sh/

They can still be both! You can flip the general structure of man pages to be examples first while still having all the complete reference material after.

Or just use tldr, which already does what you want.

Re: Become Shell Literate

#272

> I can work with this. I add grep '^ D' to filter out any entries which were not deleted, and pipe it through awk '{ print $2 }' to extract just the filenames. Best hope your file names don’t have spaces in them. One of the downsides of the shell on Unix is that everything is usually text meant for humans so you have to spend an annoying amount of time dealing with delimiters that make it easy on the eyes but a pain…

couldn't agree more. waiting on nushell to mature so that rich data is the norm for shell stuff.

learning to be comfy in shell is still worth it though. It's saved me, at minimum, hundreds of hours of work.

Re: Become Shell Literate

#273
post #200
post #41

Earlier quoted context omitted.

Just suggested it in another comment, but Fish might be similar to what you describe. It has tab-completable flags that it gets from the manpages, and remembers and suggests previously run commands which might be close to the auto-complete you're after.

Fish is better, but it still only gets 1/10th of the way. Why does terminal have to look like terminal? Like why is the 1980's ASCII telnet style the only way to do this? The ASCII fish image on boot and fully ASCII menus only reinforces again that this isn't a modern interface, its an improved 1980's interface. Why, for example, can autocomplete not look like this? https://code.visualstudio.com/docs/editor/intellise…

because then your shell will be slower than a snail.

for real though, after looking at your examples I feel that features like those would fall on your terminal emulator to bring to the table, not the shell itself.

specifically, I don't want to imagine trying to connect to a headless server during some crisis over bad wifi and have the shell think it needs to send a bunch of graphics to me.

Re: Become Shell Literate

#274
post #50
post #12

Earlier quoted context omitted.

It wouldn't be coherently unixy if it was. Small tools that do a limited subset of things, and reliably take/output data from stdin/stdout is the way unix is done. sh is just the glue we use to tack it all together. Bash (and other shells too) is like it is, because it's an accretion of 50 years of history rather than a singular top down design.

I think a misunderstood part of Emacs is that this is exactly what it is—-it’s just glue, but instead of being in a command-oriented environment, it’s in an editor-oriented environment. You run the same Unix tools but glue their results together into a text buffer with a full programming language that then lets you programmatically edit the results. People joke about Emacs being an OS but it’s really just a different…

Without commenting on substance, Emacs is an application that rehomed itself on unix, but isnt a genetic unix application, Emacs was developed on ITS.

Re: Become Shell Literate

#275

I used to think this way as well, but out of necessity, had to work specifically with a commercial IDE for some time. Turns out, if you are confident learning the keybindings of a robust IDE is worthwhile (e.g. you know that you must use it for some particular project for a decent amount of time) the investment pays off just as well as learning shell commands. A good IDE can do everything a cobbled together shell pip…

Yes, the IDE is supposed to be faster for the things it was designed to do. That's the whole reason for its existence. But the shell allows you to do much more than your IDE was supposed to do. If you don't learn it, you're confining yourself to the boundaries set by the IDE.

Re: Become Shell Literate

#276

Earlier quoted context omitted.

I literally said that "IDEs are great tools" and my whole argument was that people can broaden their understanding by also learning some shell in addition to their IDE. So not sure what your point is.

I'm sure that was your true intent, but the way you framed it made it seem like it was in exclusion(the dismissive "Cool." at the top didn't help). At the risk of sounding patronizing as much as we'd like to everything to be binary pass/fail and survive on the technical merits or semantic details, how you frame things and driving communication in an inclusive way is important of you want to convince people that somet…

I agree, but I can only control how other people understand my words to some degree, especially in a fast paced, low effort forum conversation. The prejudice of the reader will drive their interpretation more than my actual intent.

You can read my comments as gatekeeping or as the exact opposite - an invitation to come through the gate and see what you can learn here and take what is useful to you.

Re: Become Shell Literate

#277
post #28
post #4

I wish that shell would be more sane. I don't think that a shell should be a complete programming language. If you need a programming language, then better use one. There is xonsh if you are looking for something like this. I think there should be a better bash with an very clean and consistent interface. Some of the most commonly used utils like awk '{ print $2}', sed, grep, sort, ... should be included out of the b…

> I think there should be a better bash with an very clean and consistent interface. Absolutely! Some work should be put into making it way more intuitive. Having to remember what every flag means (which is different in every app!) is not intuitive at all. By default there should be some sort of intelisense auto-complete which can also provide guidance on what on earth all the flags mean, and maybe eventually it coul…

This is exactly what I’ve been working on with Fig. Intellisense exists in every modern IDE but not the shell.

https://github.com/withfig/autocomplete

Re: Become Shell Literate

#278

I can just never get past the arg/flag inconsistency/complexity across commands. Perhaps if the docs started with a simple example of what has been seen over time to be the most common incantation for each command it might be tolerable. But as it is, I spend more time dealing with idiosyncracies of a command than I do expressively piping stuff. Perhaps if Rust had five mutually incompatible borrow-checkers which get…

You might want to look into the ‘tldr’ command for those simple shell examples. It’s a very helpful command.

Re: Become Shell Literate

#280

Author here! Some extra tips for HN: If you dislike POSIX sh, consider looking at Plan 9's rc before you look anywhere else (including bash): http://man.9front.org/1/rc Also, I would advise you to learn about these four tools in depth: sh, sed, awk, and make. Learn when to use each, and don't use one when another would be better.

Thanks !
Post reply on HN