Skip to content

exit

Stop script execution immediately.

exit
# Stop script execution
print "before"
exit
  • exit is a clean stop, not an error: actions produced before it have already executed, everything after it is skipped.
  • It stops the whole script from anywhere — including inside loop blocks and def command bodies. Use loop break to leave just the loop, or def return to leave just the command body.
  • if — conditional execution
  • looploop break / loop continue for loop-scoped exits
  • defdef return for command-body exits