Reputation: 1971
Bash shell uses -e switch to stop the execution when there is an error during execution of the current command. Is there a similar way to do the same thing in tcl or should I use catch command?
Upvotes: 1
Views: 10177
Reputation: 13252
If you are using a shell-like tool that runs Tcl script and it does not have any option to quit on errors, then yes, you will have to catch errors yourself and call exit
from within the error handler. You can use either the catch
or the try
command to do so.
Documentation: catch, exit, try
Upvotes: 1