3 ms·
Short answer: because it's Bash. No syntax or language construct will do what you expected.
by NackerHughes 4y ago
Short answer: because it's Bash. No syntax or language construct will do what you expected.
- deleted 4y ago[deleted]
- realharo 4y agoSometimes it also depends on the specific version, like when you need to deal with empty arrays - https://stackoverflow.com/questions/7577052/bash-empty-array-expansion-with-set-u/61551944 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.
- lopatin 4y agoI 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.