IN a lot of shell scripts I write I usually test for the presence of other external commands, that have all to be found and tested like the following:
I was guessing if, apart from making the above a function, there is some smarter piece of code to search for and test the executable bit of a command by its name.
Code:
PERL_CMD=$( which perl )
if [ -z "$PERL_CMD" ]
then
# something wrong
fi
I was guessing if, apart from making the above a function, there is some smarter piece of code to search for and test the executable bit of a command by its name.