Require a dependency before running script logic.
Section: Files and Temporary Paths
Check if command exists
bash
bash
if ! command -v jq >/dev/null 2>&1; then echo 'jq required'; exit 1; fiExplanation
Portable and very common in setup scripts.
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 Files and Temporary Paths