A nifty code snippet that will allow you to check for the availability of a command.


if type "command-name" &> /dev/null; then
echo "Command exist!"
echo "Command does not exist! :("

Used this myself for a script, where I wanted to make sure a certain command was available before continuing the script execution.
That being said; it was a bit of a pain to figure out how to do this, while searching the web for answers!

Solution discovered, solution shared.