In a csh script, I need to perform something only if a certain command is available. I wanted to do something like
if( _WHAT_TO_PUT_HERE_ ) then # enter only if command "cmd" is in the path
cmd ...
endif
how to do that in csh or tcsh?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I guess using the where command will solve your issue
Check this:
so lets say you are trying to find a command named my_cmd
try the following code: