3 ms·
This[1] Stack Overflow question sums up everything I dislike about shell scripting. Not only does it highlight the finnicky string-oriented nature of it, but th
by nlawalker 10y ago
This[1] Stack Overflow question sums up everything I dislike about shell scripting. Not only does it highlight the finnicky string-oriented nature of it, but the answers...
Multiple contradictory answers, disagreement, sub-sub-sub explanations, historical context, caveats, workarounds, hypothetical scenarios, portability, personal taste, different versions and implementations all show up. One answerer felt the need to include a footnote.
It's like the opposite of Python's "there's one right way to do it": There are 50 right ways to do it, all of which are wrong in some case or another, potentially depending on which way the wind is blowing.
All in regards to checking for an empty string.
[1] http://unix.stackexchange.com/questions/136628/bash-script-x1-x http://unix.stackexchange.com/questions/136628/bash-script-x...
- unknown2374 10y agoNot to start a war, but Python's "there's one right way to do it" is nothing more than an ambitious claim with little ground. Maybe it applies for doing something brainless like printing a string, but the claim completely falls apart when trying to do something as simple as list indexing/slicing or even iteration. I'm not condemning Python in anyway, I am a fan of the latter mention features, but that "zen" of Python is not applicable.
- wwweston 10y ago> Python's "there's one right way to do it" is nothing more than an ambitious claim with little ground. Probably better described as an ideal, not always lived up to, but serves as a guiding principle...