3 ms·
Before you apply `set -u` to all of your scripts, be aware that an empty array counts as undefined. So if you have arrays for which being empty is valid, be su
by LukeShu 11y ago
Before you apply `set -u` to all of your scripts, be aware that an empty array counts as undefined. So if you have arrays for which being empty is valid, be sure to `set +u` right before accessing them (and then `set -u` again after).
- anderskaseorg 11y agoOr write ${arr+"${arr[@]}"}, which is, you know, only slightly more awkward than bash arrays already were to begin with. Really you just want to use a real programming language instead.