Live data from Hacker News

Ask HN: What to use instead of Bash / Sh for scripting?

news.ycombinator.com

91–100 of 106 posts

Re: Ask HN: What to use instead of Bash / Sh for scripting?

#92

Earlier quoted context omitted.

I don't have a problem - I don't use bash unless its few lines or absolute must. 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.

> launching process to achieve simple math expression is just ridiculous That's why you don't do that. $(( math goes here ))

That is also ridiculous as it starts subshell/subprocess.

Re: Ask HN: What to use instead of Bash / Sh for scripting?

#93
post #85

Earlier quoted context omitted.

Yeah, i forgot to add my thoughts on PowerShell. It's great for Windows and nothing else. Its power isn't syntax (which is a bit weird) but the fact that it interfaces with all the Windows APIs. I can't really imagine it on any other platform. If you're on Windows and nowhere else, PS is superior to bash. Have you been using bash on Windows? If so, why? Cross-Platform?

PS is superior to bash, period, no matter platform. You are talking about something else entirely, like added benefit of lots of Windows tools supporting PowerShell automation. While that is nice, the major appeal of pwsh for me is not the ecosystem but the paradigm and language - in bash, you always do something irrelevant to your current task as anything requires excessive boilerplate and all supportive utilities a…

> PS is superior to bash, period, no matter platform

Simply untrue. See [1]. PS _may_ be superior _where it exists_, but without question it is available in far fewer places than bash.

[1]: https://github.com/PowerShell/PowerShell/issues/12612

Re: Ask HN: What to use instead of Bash / Sh for scripting?

#95

Earlier quoted context omitted.

> launching process to achieve simple math expression is just ridiculous That's why you don't do that. $(( math goes here ))

That is also ridiculous as it starts subshell/subprocess.

Neither [ nor $(()) start subshells/subprocesses. [ is built-in in pretty much every shell, and there's absolutely no reason for any shell to make a subshell/subprocess for $(()). You might be confusing it with $().

In any case, worrying about subprocesses and their slowness in a shell is completely moot. Shells aren't built to run fast, and are rather built to work with executables conveniently.

> besides having to terminate it with ;

Is that really a complaint? Does that bother you a lot? This seems so petty, I'm a bit lost for words.

[ is a regular command because the control structures of the shell are flexible enough to support any command for their conditions.

I don't know if you're asking for the shell to make a super-special exception in its syntax for that particular command just so that people won't have to type ; under certain circumstances, or if you're asking for control structures to be more restricted and allow only [ instead of any command for their conditions.

> they must have been smoking some nasty things back in time.

So far, you've given the impression of someone complaining that screwdrivers really suck for inserting nails. I wonder if the issue is that you've never seen hammers before or if you've never seen screws before. Or maybe the issue is you believe each tool should be equally fit for everything?

Re: Ask HN: What to use instead of Bash / Sh for scripting?

#99

Earlier quoted context omitted.

> launching process to achieve simple math expression is just ridiculous That's why you don't do that. $(( math goes here ))

That is also ridiculous as it starts subshell/subprocess.

Demonstrably false.

And even if not, so what? Every argument you make is a shifting of a goalpost.

Post reply on HN