News for hackers. Stuff that matters.
Re:When Bash scripts bite by viraptor on Friday May 12, 2017 @12:18AM (#14321410)
Definitely not OCaml, but usually python or ruby will do the job better.
Re:When Bash scripts bite by BoorishBears on Friday May 12, 2017 @02:22AM (#14321820)
We use node at work now. The fact is it's not worth it trying to get everyone to write good bash scripts. Js doesn't have nearly as many foot guns and there's a library for just about anything you could want to do.
Re:When Bash scripts bite by mbrock on Friday May 12, 2017 @04:38AM (#14322318)
Error handling in asynchronous JavaScript is quite notorious for being easy to screw up.
Re:When Bash scripts bite by nilliams on Friday May 12, 2017 @05:23AM (#14322492)
True for async code, but if you use something like ShellJS [1] (which would be an easy way to rewrite a bash script that was getting out of hand), all commands are synchronous, so error handling is just try/catch.

[1] https://www.npmjs.com/package/shelljs

Re:When Bash scripts bite by moosingin3space on Friday May 12, 2017 @03:48PM (#14327279)
If only everyone used promises...I can dream, right?

Regardless, I'd actually prefer Haskell's do-notation for both asynchronous commands and shell-scripting tasks. Even though Haskell isn't my favorite language, do-notation is quite nice for this.

Re:When Bash scripts bite by foota on Friday May 12, 2017 @03:33AM (#14322082)
Just not left pad ;-)