I\'m working on a Ubuntu system and currently this is what I\'m doing:
if ! which command > /dev/null; then echo -e \"Command not found! Install? (y/n)
This seems to work pretty well.
$ sudo dpkg-query -l | grep | wc -l
0
> 0