【发布时间】:2020-01-22 01:17:04
【问题描述】:
如何在嵌套的 json 中用 jq 查找和替换值。
{
"layout": {
"menu-layout": {
"type": "section",
"title": "Layout and content",
"keys": [
"show-category-icons",
"favbox-show",
"favbox-min-height",
"show-places",
]
},
"menu-behave": {
"type": "section",
"keys": [
"enable-autoscroll",
"search-filesystem"
]
}
},
"favbox-min-height": {
"type": "spinbutton",
"default": 300,
}
}
例如,在 teste.json 上面的这个文件中: 我想在“favbox-min-height”项中替换键:值 “默认”:300 为了 “默认”:400
我做不到,有人可以帮我做吗?
【问题讨论】:
标签: json replace nested jq edit