In this section, we will be looking at awk, sed, and tr.
awk, sed, and tr
awk
awk (including the gnu implementation, gawk) is designed for streaming text processing, data extraction, and reporting. An awk program is structured as a set of patterns that are matched, and actions to take when those patterns are matched:
pattern {action}
pattern {action}
pattern {action}
…
For each record (usually each line of text passed to awk), each pattern is tested to see whether the record matches, and if so, the action is taken. Additionally, each record is automatically split into a list of fields by a delimiter (any run of whitespace by default). The default action, if none is given, is to print the record. The default pattern is...