I have a script to check my environment, and I would like to ask your advice on how to handle "command not found" errors.
echo "...RVM Version : $(rvm -v)" echo "...Node Version : $(node -v)" echo "...Ruby Version : $(ruby -v)" echo "...Bundler Version : $(bundle -v)" echo "...Passenger Version: $(passenger -v)" It shows "command not found" for the node and passenger commands:
...RVM Version : rvm 1.29.7 (latest) by Michal Papis deploy_confirm.sh: line 10: node: command not found ...Node Version : ...Ruby Version : ruby 2.6.0p0 (2018-12-25 revision 66547) ...Bundler Version : Bundler version 2.0.1 deploy_confirm.sh: line 13: passenger: command not found ...Passenger Version: Instead of showing an error I would like to show "Not found", like this:
...RVM Version : rvm 1.29.7 (latest) by Michal Papis ...Node Version : Not found ...Ruby Version : ruby 2.6.0p0 (2018-12-25 revision 66547) ...Bundler Version : Bundler version 2.0.1 ...Passenger Version: Not found