DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(gawk.info) Statements

Info Catalog (gawk.info) Patterns and Actions (gawk.info) Top (gawk.info) Built-in Variables
 
 Control Statements in Actions
 *****************************
 
    "Control statements" such as `if', `while', and so on control the
 flow of execution in `awk' programs.  Most of the control statements in
 `awk' are patterned on similar statements in C.
 
    All the control statements start with special keywords such as `if'
 and `while', to distinguish them from simple expressions.
 
    Many control statements contain other statements; for example, the
 `if' statement contains another statement which may or may not be
 executed.  The contained statement is called the "body".  If you want
 to include more than one statement in the body, group them into a
 single "compound statement" with curly braces, separating them with
 newlines or semicolons.
 

Menu

 
* If Statement                Conditionally execute some `awk'
                                 statements.
* While Statement             Loop until some condition is satisfied.
* Do Statement                Do specified action while looping until some
                                 condition is satisfied.
* For Statement               Another looping statement, that provides
                                 initialization and increment clauses.
* Break Statement             Immediately exit the innermost enclosing loop.
* Continue Statement          Skip to the end of the innermost enclosing
                                 loop.
* Next Statement              Stop processing the current input record.
* Nextfile Statement          Stop processing the current file.
* Exit Statement              Stop execution of `awk'.
 
Info Catalog (gawk.info) Patterns and Actions (gawk.info) Top (gawk.info) Built-in Variables
automatically generated byinfo2html