Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #14805 > unrolled thread
| Started by | Grisha Levit <grishalevit@gmail.com> |
|---|---|
| First post | 2018-11-12 16:32 -0500 |
| Last post | 2018-11-12 16:32 -0500 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
null array[*] expansion not treated as null Grisha Levit <grishalevit@gmail.com> - 2018-11-12 16:32 -0500
| From | Grisha Levit <grishalevit@gmail.com> |
|---|---|
| Date | 2018-11-12 16:32 -0500 |
| Subject | null 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>
Back to top | Article view | gnu.bash.bug
csiph-web