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

2018-11-06 Thread Great Big Dot
Crap, looks like I accidentally just replied to a single person instead of the whole list. Here it is (and sorry if I'm uselessly cluttering up everyone's inboxes!): -- Forwarded message - From: Great Big Dot Date: Tue, Nov 6, 2018 at 5:45 PM Subject: Re: Indices of array variable

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

2018-11-06 Thread Great Big Dot
On 11/5/18 8:44 PM, Great Big Dot wrote: > > What's actually happening here is that the *indirection* expansion > > "${!foo}", and not the *indices* expansion "${!foo[@]}", is what is being > > preformed on something like "${!array[@]-}". Both expansions, while > > unrelated, happen to use the sam

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

2018-11-06 Thread Chet Ramey
On 11/5/18 8:44 PM, Great Big Dot wrote: > What's actually happening here is that the *indirection* expansion > "${!foo}", and not the *indices* expansion "${!foo[@]}", is what is being > preformed on something like "${!array[@]-}". Both expansions, while > unrelated, happen to use the same syntax

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

2018-11-06 Thread Chet Ramey
On 11/5/18 4:42 PM, Great Big Dot wrote: > Description: > The parameter expansion "${!var[@]}" expands to the indices of an array > (whether linear or associative). The expansion "${var-string}" > returns "${var}" iff var is set and 'string' otherwise. These two > features do not

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

2018-11-06 Thread Greg Wooledge
On Mon, Nov 05, 2018 at 08:04:49PM -0500, Great Big Dot wrote: > Hold up... when I view this email on the public archives, all of my > "${array[@]}"'s (that is, "${array[]}"'a) got turned to > "address@hidden"'s. Sadly, there's nothing we can do about that. The maintainers of the list archive wou