How to check if a program exists from a Bash/Shell script
You can look to use:
command -v <the_command>
There are also 2 other ways, that we will run through a little further down, but for now..
How to use the command
if a conditional
To summarize, there are 3 ways you can do this
Option 1 - Using command
|
|
Option 2 - Using type
|
|
Option 3 - Using hash
|
|