Reputation: 1919
I would like to know if there is a way to catch the exceptions and control the flow when this happen. For example running this line, I would like to know if a shell error occurred .
source /scripts/scriptThatWillFail.csh
Upvotes: 2
Views: 4337
Reputation: 5315
The exit/return code is stored in the status
variable in C shell.
source /scripts/scriptThatWillFail.csh
if ($status != 0) then
echo failed
else
echo passed
endif
Upvotes: 1