0

I have below JSON file and would like to update the values of these keys --resType and --LogLevel using jq.

{
    "--resType": "FILE",
    "--LogLevel": "INFO"
}

To do that, I am using below command.

./jq .--resType=Test config.json>test.json

But, I see an error that says

"jq: error: Test/0 is not defined at , line 1:".

"jq: 2 compile errors"

2
  • 1
    You do a special quote around the keys to let it to be understood as a valid key name jq '."--resType"' config.json or another way with the square braces [..] as jq '.["--resType"]' config.json Commented Oct 1, 2019 at 6:53
  • ./jq '."--resType"'=\"Test\" config.json >test.json worked for me. Thank you. Commented Oct 1, 2019 at 14:17

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.