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

Short answer: because it's Bash. No syntax or language construct will do what you expected.


I tend to think of Bash as a syntax-free language. There are no clear rules, you just have to kind of make it work every time. It's like the programming version of a freestyle rap or Parkour.


It's more of a pidgin. Syntax and semantics made up on the fly to suit the need of the moment, and then made permanent once used. No overarching design or consistency.


Hell, Perl is at least consistent in its insanity


Sometimes it also depends on the specific version, like when you need to deal with empty arrays - https://stackoverflow.com/questions/7577052/bash-empty-array...

The answers there are just a few of the many great examples of why bash is best avoided in almost all cases.




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

Search: