Here are 3 styles of checking for an existing program...... anyone have another way, or a better way/different way. ???
Code:
if ! which slocate >/dev/null ; then
echo " "
echo "slocate is not detected";
echo "you need it installed. Exiting...";
false; exit;
fi
if [[ -z $( type -p mplayer ) ]]; then
echo " "
echo "mplayer is not detected";
echo "you need it installed. Exiting...";
false; exit;
fi
which convert &>/dev/null
if [ $? != "0" ];
then
echo -e "ImageMagick -- NOT INSTALLED";
else
echo "ImageMagick -- Installed";
fi