On Sunday, March 24, 2024, Zachary Santer <[email protected]> wrote: > > Yeah, but what can you do with @k?
It helps when reconstructing an associative array as a JSON object in JQ
$ declare -A a=([x]=1 [y]=2)
$ jq --args -n '[$ARGS.positional | _nwise(2) | {(.[0]): .[1]}] | add'
"${a[@]@k}"
{
"y": "2",
"x": "1"
}
--
Oğuz
