Ask HN: What to use instead of Bash / Sh for scripting?
41–50 of 106 posts
Re: Ask HN: What to use instead of Bash / Sh for scripting?
#42I’ve seen people use Go because it’s a simpler language. It’s what I would probably use if I didn’t want to use bash. What do you think about editing the title to include “for scripting”? I thought you were asking for recommendations like zsh or fish when I first clicked
Also go has the advantage of producing a single static binary. Easy to build on your machine and run on another host.
Deployment or installation is just one scp away.
not rewriting, just when It needs large refactoring, or is currently a mess, or brand new.
Re: Ask HN: What to use instead of Bash / Sh for scripting?
#43Earlier quoted context omitted.
Also go has the advantage of producing a single static binary. Easy to build on your machine and run on another host.
Which is why I'm writing most of my tooling in Rust . Deployment or installation is just one scp away. not rewriting, just when It needs large refactoring, or is currently a mess, or brand new.
Re: Ask HN: What to use instead of Bash / Sh for scripting?
#44 https://amoffat.github.io/sh/sections/faq.htmlRe: Ask HN: What to use instead of Bash / Sh for scripting?
#45Earlier quoted context omitted.
Which is why I'm writing most of my tooling in Rust . Deployment or installation is just one scp away. not rewriting, just when It needs large refactoring, or is currently a mess, or brand new.
Assuming you're deploying to the same OS/architecture that you're working from, otherwise you'd have to rebuild (which Rust makes easy to do, but still)
Re: Ask HN: What to use instead of Bash / Sh for scripting?
#46Re: Ask HN: What to use instead of Bash / Sh for scripting?
#47Earlier quoted context omitted.
Powershell is a horror you mean, it's got the verbosity of objective c with the consistency that comes with all Microsoft designed products. Just use a proper scripting language.
No, I said what I mean. Bash and its disasters like [ as executable and mega error prone and awkward language designed 50 years ago IS horror. Verbosity of powershell is optional, I don't use it. > consistency that comes with all Microsoft designed products. Oh, lets not troll here.
Why is that a disaster? What problem has it caused you that wouldn't have happened if it wasn't an executable?
[[ is a non-executable version of [. Does that solve your problem?
Re: Ask HN: What to use instead of Bash / Sh for scripting?
#48If you want strong typing (are you scripting in the large?), then, almost by definition, no scripting language provides that. If you need performance, switch to a compiled language (or a jit-compiled interpreted language) that most of your co-workers understand.
If Python brings too many dependencies, I guess you're trying to do something that is way out of the realm of possibility for bash, so you're not looking for an "alternative" to bash, you're looking for the best language for whatever project you're undertaking. And you may not be able to get away from the dependencies if you're trying something specific/sophisticated.
Re: Ask HN: What to use instead of Bash / Sh for scripting?
#49Earlier quoted context omitted.
No, I said what I mean. Bash and its disasters like [ as executable and mega error prone and awkward language designed 50 years ago IS horror. Verbosity of powershell is optional, I don't use it. > consistency that comes with all Microsoft designed products. Oh, lets not troll here.
> its disasters like [ as executable Why is that a disaster? What problem has it caused you that wouldn't have happened if it wasn't an executable? [[ is a non-executable version of [. Does that solve your problem?
Its disaster because launching process to achieve simple math expression is just ridiculous, besides being slow and besides having to terminate it with ;. Its wrong on so many levels I don't even know where to start, they must have been smoking some nasty things back in time.