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: Greg Wooledge
Subject: Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax
Date: Fri, 22 Mar 2024 12:54:12 -0400

On Fri, Mar 22, 2024 at 11:23:35AM -0400, Chet Ramey wrote:
> This is what you can do with @K.
> 
> https://lists.gnu.org/archive/html/bug-bash/2021-08/msg00119.html
> 
> Word splitting doesn't happen on the rhs of an assignment statement, so you
> use eval. The @K quoting is eval-safe.

It would be good to include that information in the manual.  I only
see this in the man page:

              K      Produces a possibly-quoted version of the value of param‐
                     eter, except that it prints the values of indexed and as‐
                     sociative arrays as a sequence of quoted key-value  pairs
                     (see Arrays above).

The reader is left wondering whether it's eval-safe.

Also, I don't see the lower-case k transformation in the man page.



reply via email to

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