Go forward to Actions.
Go backward to One-liners.
Go up to Top.
Patterns in `awk' control the execution of rules: a rule is executed
when its pattern matches the current input record. This chapter tells
all about how to write patterns.
- Kinds of Patterns
- A list of all kinds of patterns.
The following subsections describe
them in detail.
- Regular expressions such as `/foo/'.
- Comparison Patterns
- Comparison expressions such as `$1 > 10'.
- Boolean Patterns
- Combining comparison expressions.
- Expression Patterns
- Any expression can be used as a pattern.
- Pairs of patterns specify record ranges.
- Specifying initialization and cleanup rules.
- The empty pattern, which matches every record.