Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14805 > unrolled thread

null array[*] expansion not treated as null

Started byGrisha Levit <grishalevit@gmail.com>
First post2018-11-12 16:32 -0500
Last post2018-11-12 16:32 -0500
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug


Contents

  null array[*] expansion not treated as null Grisha Levit <grishalevit@gmail.com> - 2018-11-12 16:32 -0500

#14805 — null array[*] expansion not treated as null

FromGrisha Levit <grishalevit@gmail.com>
Date2018-11-12 16:32 -0500
Subjectnull array[*] expansion not treated as null
Message-ID<mailman.3945.1542058363.1284.bug-bash@gnu.org>
When an array A has non-zero elements but the expansion of "${A[*]}" is
still
a null string, it is not treated as such for purposes of ${var:-X} expansion
(though $* is treated as null in the same circumstance).

    $ A=(''); set -- ''
    $ echo "<${A[*]:-X}>" "<${*:-X}>"
    <> <X>

    $ IFS=
    $ A=('' ''); set -- '' ''
    $ echo "<${A[*]:-X}>" "<${*:-X}>"
    <> <X>

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web