help-bash
[Top][All Lists]
Advanced

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

Re: How do we get state of a flag in set -o ...


From: Grisha Levit
Subject: Re: How do we get state of a flag in set -o ...
Date: Tue, 11 Jul 2023 19:57:38 -0400

On Tue, Jul 11, 2023, 18:47 Greg Wooledge <greg@wooledge.org> wrote:

> Now, obviously you could throw in 'eval' into the picture, but then you
> would need to use "${list[@]@Q}" or something.
>

I think the canonical way is to use the @K transformation, making sure the
rhs of the assignment is quoted:

$ declare -A A=('k $1' 'v $1')
$ declare -A B="(${A[@]@K})"
$ declare -p B
declare -A B=(["k \$1"]="v \$1" )


reply via email to

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