Is this mean?
``` bash
which keychain
if [ $? eq 0]; then
   ....
```