2 ms·
"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
by 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)