3 ms·
>where { ACTION } is optional and defaults to { print } There's more to that: Either PATTERN or { ACTION } is optional (but not both). If no PATTERN is given,
by vram22 7y ago
>where { ACTION } is optional and defaults to { print }
There's more to that:
Either PATTERN or { ACTION } is optional (but not both).
If no PATTERN is given, the default means "match every line" (and so do the given ACTION for every line).
The ACTION could be anything (even an explicit print, whether or not PATTERN is given), summing up some column, filtering more on substring(...), assigning values to variables, comparing variables and doing actions based on them (awk's if statement), calling a built-in or user-defined function, etc.