jq
could have predefined variables and replace with --arg
options. It works well with string. However, I don't know how to replace the variable as number.
$jq -n --arg number 3000 '{"number":$number}'
{
"number": "3000"
}
I would like to be able to generate something as following :
{
"number": 3000
}
Thanks in advance.
Or:
or (as Jeff pointed out) with jq 1.5:
or (with versions of jq after June 26, 2015):