I am trying to use jqto build a hash in which the key name comes from a variable. Something like that:
jq --null-input --arg key foobar '{$key: "value"}'
However, this does not work and gives the following error:
error: syntax error, unexpected '$'
{$key: "value"} 1 compile error
source
share