Ich habe ein json-Like
{"2xx_count":10,"3xx_count":11}
aber ich bekomme Fehler wie folgt:
$ echo '{"2xx_count":10,"3xx_count":11}' | jq .2xx_count
error: syntax error, unexpected IDENT, expecting $end
.2xx_count
^^^^^^^^
1 compile error
echo '{"2xx_count":10,"3xx_count":11}' | jq '.["2xx_count"]'
@lluchs danke!
@lluchs
Wie macht man das mit key_name als Variable? Beispielsweise
cat data.json | jq '.["$1"]'
wobei $1 der erste Parameter ist ?
Hilfreichster Kommentar