On Fri, Oct 21, 2016 at 09:19:08PM -0700, L. A. Walsh wrote: > Eduardo Bustamante wrote: > >what's wrong with?: > >echo ${#array[@]}
> Not when "-u" is set, which I often have on to help catch misspellings. > > set -u > echo ${#array[@]} > bash: array: unbound variable See http://mywiki.wooledge.org/BashFAQ/112 set -u is almost as bad as set -e. It's a poorly implemented crutch which breaks scripts that would otherwise work. If you're going to file bug reports about your scripts breaking when you use set -u, you should at least mention that in the initial bug report.