Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because bash error handling is a thousand blades and no handle.

https://blog.habets.se/2021/06/The-uselessness-of-bash.html

I've reviewed a lot of code, bash and otherwise. I have never, not once, reviewed bash code that didn't have subtle bugs. And this is code written by smart people.



> Because bash is thousand blades and no handle.

FTFY.

It really is absolutely terrible tool as programming language. If your script is more than "a bunch of pipes in a trench coat" just use something else. I'd unironically prefer Perl to it.


The final straw for me was when I (described in my blog post) realized that not even "foo | bar" does the right thing.


Is there any good alternative to bash for stringing together multiple commands with pipes and redirections?

"Real" programming languages usually have painful-to-use APIs for calling commmands, redirecting output, piping one command to another, etc.


Tcl would be a good choice here - https://www.tcl.tk/man/tcl8.5/tutorial/Tcl26.html


Powershell core. It's actually usable and allows to use .net tools if you need to break out the big guns. Main drawback is the stupid channel thing, but that's manageable.


Of course it's not ironic. Perl's raison d'entre is to replace bash+grep+sed+awk




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: