[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.
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, (continued)
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Lawrence Velázquez, 2024/03/20
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Zachary Santer, 2024/03/20
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Greg Wooledge, 2024/03/20
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, alex xmb sw ratchev, 2024/03/20
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Greg Wooledge, 2024/03/20
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Léa Gris, 2024/03/20
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, alex xmb sw ratchev, 2024/03/20
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Lawrence Velázquez, 2024/03/20
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Zachary Santer, 2024/03/20
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Chet Ramey, 2024/03/22
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax,
Greg Wooledge <=
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Lawrence Velázquez, 2024/03/22
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Greg Wooledge, 2024/03/22
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Zachary Santer, 2024/03/24
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Oğuz, 2024/03/24
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Greg Wooledge, 2024/03/24
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Oğuz, 2024/03/24
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Oğuz, 2024/03/24
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Greg Wooledge, 2024/03/24
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Lawrence Velázquez, 2024/03/24
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Dennis Williamson, 2024/03/24