GNU Info  Info Node: (gawk.info)Exit Statement  (gawk.info)Exit
Statement  Prev: Nextfile Statement Up: Statements Enter node ,
(file) or (file)node  The `exit' Statement     The `exit'
statement causes `awk' to immediately stop executing the current
rule and to stop processing input; any remaining input is
ignored.  The `exit' statement is written as follows:       exit
[RETURN CODE]     When an `exit' statement is executed from a
`BEGIN' rule, the program stops processing everything
immediately.  No input records are read.  However, if an `END'
rule is present, as part of executing the `exit' statement, the
`END' rule is executed (Note: The `BEGIN' and `END' Special
Patterns.).  If `exit' is used as part of an `END' rule, it
causes the program to stop immediately.     An `exit' statement
that is not part of a `BEGIN' or `END' rule stops the execution
of any further automatic rules for the current record, skips
reading any remaining input records, and executes the `END' rule
if there is one.     In such a ca