I'm writing a little script that, prior to doing anything, checks to see if certain required software is installed, and either bombs out or reconfigures itself not to require the missing applications. Currently it does this by seeing if a call to 'which' succeeds.
Obviously, since this is critical infrastructure, it would be nice to test that this functionality works reliably (to give some idea how critical, two of the applications I'm checking for are 'cowsay' and 'fortune'). Can anyone think of a way, short of either uninstalling or renaming, that I can temporarily fool 'which' (or some other command if there is one which would could be used to achieve what I want), into thinking something is not installed?
I think this might be useful to me in other projects which my employers would feel are almost as valuable to the enterprise as this one.
Thanks in advance!