To exit the script during the error message, use:
exit 1
This exits with an exit code 1, indicating a failure. Other non-zero numbers may be used to signal various failure conditions. exit 0signals success.
To throw an exception, use kill. To give a hang signal, for example, from a script, run:
kill -SIGHUP $$
, , :
kill -l