4 ms·
Y'all just have bias against the string system. Writing decent code in bash is just as possible as any other language. I stick to POSIX sh but same difference
by kohtatsu 7y ago
Y'all just have bias against the string system.
Writing decent code in bash is just as possible as any other language.
I stick to POSIX sh but same difference.
- unixhero 7y agoWhy POSIX sh? Bash is everywhere. I once in my career had access to and needed jobs performed on a mainframe with AIX running. It had bash, it had ruby, it had day, it had fish shell. I couldn't and can't understand why people insist on asceticism (Korn shell, POSIX sh) when nicer options are available.
- kohtatsu 7y agoEh, I simply don't need bash. Every few dozen scripts or so I'll change the shebang to bash to have more than 1 array, but other than that I seldom pine anything that it has to offer. I believe it's a bloated mess along with most GNU utils, so avoiding it is partially out of spite, but I wouldn't impair my code to do so.
- m4r35n357 7y agodash is 10% of the size of bash. You don't need the interactive features when running shell scripts, and the few "extra" features are pretty crap anyway (arrays? yeah right).
- unixhero 7y ago*zsh ... Not "day"
- BiteCode_dev 7y ago"Thirteen Incorrect Ways and Two Awkward Ways to Use Arrays" http://www.oilshell.org/blog/2016/11/06.html http://www.oilshell.org/blog/2016/11/06.html
- kohtatsu 7y agoYeah I should clarify; I think it's well past the time of sh. Still, sh is unrivaled for portability and brevity/velocity; I wouldn't swap virtually any the shell scripts I've written for python scripts. I think sh is a decent and often well-suited tool if you can manage to wield it properly (not a straightforward endeavor). I look forward to checking out oilshell though, so thank you~ Edit: FWIW for arrays in POSIX sh I generally only use: set -- a b c echo $# echo "$1" shift echo "$@" Once in a blue moon "$*" or maybe an unquoted $@. See 2.5.2 of https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V... (My go-to reference)