This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the bash category.
Last Updated: 2023-03-28
command -v in an if statement
#!/usr/bin/env bash if command -v rg; then rg ... else echo "Dependencies: ripgrep missing" echo "(on macos): brew install ripgrep" fi