bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "${assoc[@]@k}" doesn't get expanded to separate words within compou


From: Dennis Williamson
Subject: Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax
Date: Sun, 24 Mar 2024 16:27:57 -0500

On Sun, Mar 24, 2024 at 4:04 PM Greg Wooledge <greg@wooledge.org> wrote:

> The @K (capital) transformation gives you quoted strings which need to
> be eval'ed.  Very Bourne-shell-ish.
>
> The @k (lowercase) transformation gives you a list of alternating raw
> key/value strings, like what you'd expect from a Tcl command.
>

I apologize. I didn't test the transforms properly.

>> Thus the @K allows preserving indices in a sparse
>> indexed array.

> Both of them do that:

Yes. I didn't mean to imply that one didn't. The main point I intended to
make was that your statement

>>> The main difference would be that with an indexed array, every argument
after the array name becomes an array element, instead of half of them
being keys and the other half being values.

missed that.

-- 
Visit serverfault.com to get your system administration questions answered.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]