Live data from Hacker News

The bash book to rule them all

fabiensanglard.net

31–40 of 56 posts

Re: The bash book to rule them all

#31
post #30

Controversial perhaps, but I now use Go where I used to be a prolific shell script script coder. Main reasons: - Fewer opportunities for foot-guns - Ease of portability, no dependencies, e.g. no more "is jq installed ?" - Consistent cross-platforms, e.g. no more "is this system using GNU sed ?" - Modern stuff like crypto, and "internet stuff" is just quicker and easier to do in Go.

I can't go along with your reasons at all (installing go on every machine is not solving a portability problem, it is the portability problem) but I'm going to leave that aside. can Go be used REPL as a shell CLI? and do everything I need to do from the CLI? because that's why I use bash for scripting. An equal amount of time I spend typing at the command line, and I one language is the language I want to use.

It’s not go as a literal replacement for bash, as in you write golang when interacting with your own machine. It’s go binaries instead of bash scripts. You’re still distributing one file, but now with all the GP’s stated benefits

Re: The bash book to rule them all

#33
post #11

Controversial perhaps, but I now use Go where I used to be a prolific shell script script coder. Main reasons: - Fewer opportunities for foot-guns - Ease of portability, no dependencies, e.g. no more "is jq installed ?" - Consistent cross-platforms, e.g. no more "is this system using GNU sed ?" - Modern stuff like crypto, and "internet stuff" is just quicker and easier to do in Go.

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.)

Re: The bash book to rule them all

#34
post #30

Controversial perhaps, but I now use Go where I used to be a prolific shell script script coder. Main reasons: - Fewer opportunities for foot-guns - Ease of portability, no dependencies, e.g. no more "is jq installed ?" - Consistent cross-platforms, e.g. no more "is this system using GNU sed ?" - Modern stuff like crypto, and "internet stuff" is just quicker and easier to do in Go.

I can't go along with your reasons at all (installing go on every machine is not solving a portability problem, it is the portability problem) but I'm going to leave that aside. can Go be used REPL as a shell CLI? and do everything I need to do from the CLI? because that's why I use bash for scripting. An equal amount of time I spend typing at the command line, and I one language is the language I want to use.

There's a Go REPL called YAEGI, but it's not a similar experience as using a shell.

Re: The bash book to rule them all

#35
post #30

Controversial perhaps, but I now use Go where I used to be a prolific shell script script coder. Main reasons: - Fewer opportunities for foot-guns - Ease of portability, no dependencies, e.g. no more "is jq installed ?" - Consistent cross-platforms, e.g. no more "is this system using GNU sed ?" - Modern stuff like crypto, and "internet stuff" is just quicker and easier to do in Go.

I can't go along with your reasons at all (installing go on every machine is not solving a portability problem, it is the portability problem) but I'm going to leave that aside. can Go be used REPL as a shell CLI? and do everything I need to do from the CLI? because that's why I use bash for scripting. An equal amount of time I spend typing at the command line, and I one language is the language I want to use.

> (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 some homework next time before engaging in completely unfounded FUD.

Re: The bash book to rule them all

#36

Earlier quoted context omitted.

Because Python is godawful for dependencies. With Go, you write, you compile, you ship the binary, job done.

Is Go genuinely as dependency independent as bash on a fresh Linux install? If so I'd find this very interesting and perhaps worthwhile to learn. I work in an environment where everything is done at the Linux command line. I'd be thrilled to re-do some of my my complex bash scripts in Go if there is a good advantage to doing so .

Go's dependency management is in a really good state. For building your code, Go modules are generally easy to use and editor integrations exist to automatically update your dependencies as you type. Then you build a static binary and distribute it, no installers or packages required.

Re: The bash book to rule them all

#37
post #4

I usually recommend Data Science At The Command Line https://jeroenjanssens.com/dsatcl/ Not because it explains bash well, but because it fits with my data science/bioinformatics niche. It's all about these funky sort/uniq/rev/cut/uniq/awk/wc/sed patterns I use everyday fiddling with csv files.

Hi, the part about bioinformatics caught my eye. Im a software engineer wanting to move into bioinformatics or somewhere between bio+CS. If you're up for it, can i email/DM you somewhere? Just want to learn more about what the industry is like, projects or ideas to break into the field etc. My email is also on my profile.

Re: The bash book to rule them all

#38
post #30

Earlier quoted context omitted.

I can't go along with your reasons at all (installing go on every machine is not solving a portability problem, it is the portability problem) but I'm going to leave that aside. can Go be used REPL as a shell CLI? and do everything I need to do from the CLI? because that's why I use bash for scripting. An equal amount of time I spend typing at the command line, and I one language is the language I want to use.

> (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…

Can’t help but feel like the tone of your response is completely uncalled for.

Re: The bash book to rule them all

#39
post #13

Earlier quoted context omitted.

If Go why not something like Python though...?

Because Python is godawful for dependencies. With Go, you write, you compile, you ship the binary, job done.

That sounds like a lot of steps when you require interaction (e.g. for bash I list files, then try find, then xargs with echo, etc until I got what I wanted..)

Re: The bash book to rule them all

#40

Controversial perhaps, but I now use Go where I used to be a prolific shell script script coder. Main reasons: - Fewer opportunities for foot-guns - Ease of portability, no dependencies, e.g. no more "is jq installed ?" - Consistent cross-platforms, e.g. no more "is this system using GNU sed ?" - Modern stuff like crypto, and "internet stuff" is just quicker and easier to do in Go.

Controversial opinion: I use Python for scripting. Terse syntax, but more structured than bash.
Post reply on HN