问题
I would like to have something like this
if (command_not_exists) exit
Can someone tell me how to achieve this functionality in a cshell script?
回答1:
My problem is solved using where
command (I was trying with which
command). Solution:
if(`where test_cmd` == "") then
printf "\ntest_cmd: Command not found\n";
exit(1);
endif
Thanks
来源:https://stackoverflow.com/questions/22040308/csh-script-check-if-command-exists