jq not replacing json value with parameter
问题 test.sh is not replacing test.json parameter values ($input1 and $input2). result.json has same ParameterValue "$input1/solution/$input2.result" [ { "ParameterKey": "Project", "ParameterValue": [ "$input1/solution/$input2.result" ] } ] test.sh #!/bin/bash input1="test1" input2="test2" echo $input1 echo $input2 cat test.json | jq 'map(if .ParameterKey == "Project" then . + {"ParameterValue" : "$input1/solution/$input2.result" } else . end )' > result.json 回答1: shell variables in jq scripts