html tool

2021年4月22日星期四

问题: JQ doesn't support dash - character in dictionary key names?

 https://github.com/stedolan/jq/issues/1464


.content.book1."field-2"

returns

"value-2"

$ cat tmp.json | jq '.content.book1."field-2"'
"value-2"

$ cat tmp.json | jq '.content.book1["field-three"]'
{
  "name": "THIRD",
  "url": "book1/field-three/",
  "short-url": "book1/field-three/chota-chetan"
}

没有评论:

发表评论