On 11/7/16 4:49 AM, Dan Douglas wrote: > On Sun, Nov 6, 2016 at 3:46 PM, Chet Ramey <chet.ra...@case.edu> wrote: >> On 11/1/16 5:57 AM, Dan Douglas wrote: >>> On a possibly related note, would you consider adjusting +, :+, -, :-, >>> as in "${var[@]+word}" to align with the meaning of [[ -v var[@] ]] as >>> discussed in >>> https://lists.gnu.org/archive/html/bug-bash/2014-11/msg00099.html >>> ? >> >> There's not a compelling reason to break backwards compatibility or to be >> unnecessarily incompatible with other shells that implement that construct, >> like ksh93. > > I kind of doubt anybody would know what to expect with them. :+ and :- > are particularly weird (they don't quite have to do with testing for > defined variable admittedly).
This is probably true. I think all the shells with arrays try to treat ${a[@]} in the same way as $@, which gets strange in a "scalar" context. There was a pretty extensive discussion of the $@ issue on the austin- group mailing list, which revealed big differences in how shells expand $@ in a "non-list" context. I think those differences are reflected in how those shells expand ${a[@]}. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/