Tutorial by Examples

An awk consists of patterns and actions, enclosed in curly brackets, to be taken if a pattern matches. The most basic pattern is the empty pattern, which matches any record. The most basic action is the empty action, which is equivalent to { print }, which is, in turn, equivalent to { print $0 }. If...
This pattern will allow you to filter lines depending on its length $cat file AAAAA BBBB CCCC DDDD EEEE $awk 'length($0) > 4 { print $0 }' file AAAAA $ Anyway, the pattern will allow the next code block to be executed, then, as the default action for AWK is printing the current ...

Page 1 of 1