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


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

Re: Indices of array variables are sometimes considered unset (or just display an error).

Started byGrisha Levit <grishalevit@gmail.com>
First post2018-11-06 01:03 -0500
Last post2018-11-06 01:03 -0500
Articles 1 — 1 participant

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

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  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

#14769 — Re: Indices of array variables are sometimes considered unset (or just display an error).

FromGrisha Levit <grishalevit@gmail.com>
Date2018-11-06 01:03 -0500
SubjectRe: Indices of array variables are sometimes considered unset (or just display an error).
Message-ID<mailman.3541.1541484228.1284.bug-bash@gnu.org>
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.

[toc] | [standalone]


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


csiph-web