[英]How to find and replace a value with jq in a nested json
如何在嵌套的 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”中的鍵:值“default”:300 for“default”:400
我無法做到這一點,有人可以幫我做到這一點嗎?
.["favbox-min-height"] |= (.default = 400)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.