Some of my Bash scripts need to be used on various systems I use. It is very common to call other command line tools that do some job or another, from these scripts. Sometimes I am forgetful (big surprise!) and forget to install these required applications.
So I use a simple function to check that these other applications exist, returning true or false.
Now you use the function, placing your call below the code above. This example exits the script if the application is not found.
No comments:
Post a Comment