By default jq prints a string output in double-quotes. If you want to remove the double quotes using raw option (-r) with jq to get the value of a string without the double-quotes. If you are fetching a number then this is not required as numbers are printed without any quotes. Here is a quick reference –
1 2 3 4 5 6 7 8 9 10 |
cat << EOF > data.json { "name": "debjeet", "id": 10 } EOF cat data.json | jq .id ## returns 10 cat data.json | jq .name ## returns "debjeet" cat data.json | jq -r .name ## returns debjeet |