[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: |
Oğuz |
Subject: |
Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax |
Date: |
Sun, 24 Mar 2024 21:57:06 +0200 |
On Sunday, March 24, 2024, Oğuz <oguzismailuysal@gmail.com> wrote:
>
> $ printf '%s\0' "${a[@]@k}" | xargs -0 jq --args -n '$ARGS.positional
> | _nwise(2) | {(.[0]): .[1]}' | jq -s add
>
On reflection, splitting by NULs in JQ is better; there is no guarantee
that xargs will always provide an even number of arguments.
--
Oğuz
- 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, Chet Ramey, 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, 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 <=
- 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
- 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, Dennis Williamson, 2024/03/24
- Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax, Chet Ramey, 2024/03/25