This commit is contained in:
vincent
2024-05-16 20:49:01 +08:00
parent 8885a814d6
commit 46a8b059c0
6 changed files with 36 additions and 19 deletions
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
# 修改json文件的属性值
function modify_json_file() {
local json_file=$1 # json文件路径
local key=$2 # 要修改的key
local value=$3 # 要修改的value
jq ".${key} = \"${value}\"" ${json_file} > ${json_file}.tmp
mv ${json_file}.tmp ${json_file}
}