Set shell exit code based on jq result.
Section: Arguments and Shell Integration
Use jq exit status
bash
bash
echo '{"healthy":true}' | jq -e '.healthy' > /dev/nullExplanation
`-e` is excellent for shell conditions and CI checks.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Arguments and Shell Integration
Read another JSON file into variable
Load a JSON file into jq as an array of documents.
Read one JSON file into variable
Load one JSON document into a jq variable.