exit
Stop script execution immediately.
Syntax
Section titled “Syntax”exitExamples
Section titled “Examples”# Stop script executionprint "before"exitexitis 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
loopblocks anddefcommand bodies. Useloop breakto leave just the loop, ordef returnto leave just the command body.