Live data from Hacker News

The bash book to rule them all

fabiensanglard.net

51–56 of 56 posts

Re: The bash book to rule them all

#51
post #42

Earlier quoted context omitted.

> (installing go on every machine is not solving a portability problem, it is the portability problem) but I'm going to leave that aside. What a clueless reply. Complete FUD. Yeah, you can "leave that aside" because you have no clue what you're talking about. The ONLY place Go needs to be installed is on the developer's machine. With Go you write, you compile/cross-compile and SHIP THE COMPILED BINARY job done. Do so…

I think the question assumed that you can run go in a script-language mode. Because you do want the source of shell-scripts on the local machine. So it is easy to make changes by system admins/non-developers. Scripting is for glue functionality after all…

> So it is easy to make changes by system admins/non-developers. Scripting is for glue functionality after all…

You can also use env-vars and flags in Go.

Which many would argue leads to more robust "admin glue functionality", because the admin controls how much non-admins can mess around with instead of allowing them to mess around with the core shell-script functionality.

Re: The bash book to rule them all

#52
post #33
post #11

Earlier quoted context omitted.

Even more controversial, I use Swift.

Just as controversial, I use Haskell. Everything has a type, no more interpolation foot-guns, etc. And it pays off in slowly building a library on top. (Much if not all of it applies to Swift as well I believe.)

> slowly building a library on top

What does this part mean?

Re: The bash book to rule them all

#53
post #23

The title of the book (perhaps a more useful title) is Efficient Linux at the Command Line: Boost Your Command-Line Skills by Daniel J. Barrett 2022 perhaps the book should be called Efficient Bash at the Command Line: Boost Your Linux Skills . It has a little table at the end that says "if you use a different shell". Not sure if this type thing suffuses the book a tall

For such nuances I keep this page handy: https://hyperpolyglot.org/unix-shells

Re: The bash book to rule them all

#54
post #11

Earlier quoted context omitted.

Even more controversial, I use Swift.

Swift for system operations?

I have a sh*ton of conveniences that make it good. Using Foundation only would be a pain indeed (for now; they are rewriting Foundation in Swift with better APIs, so it might get better).

Re: The bash book to rule them all

#55
post #48

Earlier quoted context omitted.

Bash is not a language, it's a shell. There is a big difference, and the differences will bite you in the ass until you learn to recognize them. For one, bash has no standard library. Different machines will have different things available. It's weird that you cite portability and then use the one solution that's pretty much the least portable. At least if you build on, say the Win32 API, you know exactly what machin…

I wrote another comment, I guess I didn't post it. Perl made a run at being the standard middle layer language like bash 30 years ago. Learning perl back then was different than for people to learn today. Back then, everybody would have known bash, and awk, and grep, and sed, and perl borrowed the their syntax/semeantics so as soon as you started using it, it was like you alrady knew it. But perl followed a trajector…

I disagree that bash is fixable for the same reason I believe that javascript isn't fixable. It's too "low-level", by that I mean whoever implements it is also implementing the entire system it's going to be living in. Javascript runs in a browser, and standardizing it means standardizing the browser. And that's just not going to happen, there are literally thousands of versions of browsers.

And so bash exists in the context of an entire unix-y system. You can fix it for yourself, but that's not going to fix the problems that bash has. No standard library. You need to build on an abstraction that you control, that can accommodate for the differences between systems. And if you want a language with a REPL, it already exists. Ruby. You can do amazing things with Pry, Ruby's true REPL, and inline Bundler. Automatic dependency management in a single-file script? Yes please! Could also do Smalltalk or a Lisp if that way of working entices.

You literally never have to touch bash/zsh/fish/whatever if you don't want to. Set your shell to Pry. In a Ruby process you can abstract over literally everything. You can use Pry's shell-integration to do bash-y stuff or you can use editor integration to open up classes or methods in emacsclient or what have you. An actual, honest-to-god, real language, specifically engineered to be human-friendly, with everything you could ever need. It can even run it's own readline, which you can modify if you feel the need.

https://github.com/ConnorAtherton/rb-readline

Re: The bash book to rule them all

#56

Incidentally this is why I think an O'Reilly is one of the most cost-effective subscriptions that I pay. It is not cheap, for sure, but I can find most book recommendations like this on it.

Also worth checking your public library to see if they're already paying for you to have a subscription. The DC Public Library offers it here.
Post reply on HN