Numeric argument passed with jq --arg not matching data with ==
问题 Here is a sample JSON response from my curl: { "success": true, "message": "jobStatus", "jobStatus": [ { "ID": 9, "status": "Successful" }, { "ID": 2, "status": "Successful" }, { "ID": 99, "status": "Failed" } ] } I want to check the status of ID=2. Here is the command I tried: cat test.txt|jq --arg v "2" '.jobStatus[]|select(.ID == $v)|.status' response: there is none I tried value 2 without quotes and still no result. By contrast, if I try the command with a literal 2 , it works: cat test