Pattern Action

Noun · Development

Definitions

  1. A programming paradigm, most associated with AWK, where rules consist of a pattern (condition) paired with an action (code block). When input matches the pattern, the corresponding action executes. Simple, powerful, and the reason AWK one-liners can replace 50-line scripts.

    In plain English: A style of programming where you say 'when you see THIS, do THAT' — the program scans through data and fires off actions whenever it spots a match.

    Example: "In AWK, /error/ { count++ } is a pattern-action rule: match lines containing error, increment the counter."

Related Terms