exit [reason]
Terminate execution of the containing script.
String reason
reason
argument of this block. If no value is provided, the string,
"exit" is substituted.
reason
argument of the block of cleanup statements
is passed the value "exit".
exit
exit
" command, saying that it is doing so
because of a timeout. As a result the single cleanup statement
prints out "Reason for exiting: timeout".
cleanup { print "Reason for exiting: ", $reason, } ... exit "timeout"
Note that if an exit statement is executed from within a block of cleanup statements, this terminates the script immediately without either completing the remaining statements, or executing the list of cleanup statements again.