On Mon, Dec 22, 2025 at 10:21 AM Greg Wooledge <[email protected]> wrote:
>
> The only known workaround is to abandon this approach entirely, and use
> @K plus eval instead.

Think the OP would want the @Q parameter transformation in this case, actually.

$ declare -a array=(a 1 b 2)
$ eval "declare -A params=( ${array[@]@Q} )"
$ declare -p params
declare -A params=([b]="2" [a]="1" )

> Both of these are "wrong" from the point of view of everybody but Chet.
> It doesn't appear this is going to change.

Maybe there's a new angle to take here. Why would a shell programmer
want the current behavior, Chet?

  • Question about... 王伟
    • Re: Quest... Greg Wooledge
      • Re: Q... Koichi Murase
        • R... Greg Wooledge
          • ... Zachary Santer
            • ... Greg Wooledge
          • ... Koichi Murase
            • ... Koichi Murase
          • ... Félix Hauri via Bug reports for the GNU Bourne Again SHell
            • ... Greg Wooledge
              • ... Félix Hauri via Bug reports for the GNU Bourne Again SHell
                • ... Félix Hauri via Bug reports for the GNU Bourne Again SHell
                • ... Greg Wooledge

Reply via email to