Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #14769
| From | Grisha Levit <grishalevit@gmail.com> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: Indices of array variables are sometimes considered unset (or just display an error). |
| Date | 2018-11-06 01:03 -0500 |
| Message-ID | <mailman.3541.1541484228.1284.bug-bash@gnu.org> (permalink) |
| References | <87va5bp5fr.fsf@gmail.com> <CAN6vQO8wb4+Peahk-+1+U6suFUPTBAYpj8vpBgGEvN-sBEBkjA@mail.gmail.com> <CAOSMAut13CHsDbwbeyMc2_XkK+rP_y-2XLWnL6_vp6Ggz-uYBg@mail.gmail.com> |
On Mon, Nov 5, 2018 at 10:38 PM Eduardo Bustamante <dualbus@gmail.com>
wrote:
> Sorry, I'm having a hard time following this email thread.
I *think* the point is that OP expected that:
(a) ${!var[@]-foo} expands to the indexes of var if ${var[@]} if set, else
to `foo'
whereas the behavior they observed is:
(b) ${!var[@]-foo} expands to the value of the variable whose name is
stored
in ${var[@]} or to `foo' if that variable is unset
Their expectation seems reasonable since "the variable whose name is stored
in ${var[@]}" is kind of a weird thing.
Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread
Re: Indices of array variables are sometimes considered unset (or just display an error). Grisha Levit <grishalevit@gmail.com> - 2018-11-06 01:03 -0500
csiph-web