awk—pattern scanning and processing language
awk [ –fprogram–file ] [ –Fc ] [ prog ] [ parameters ][ filename...]
awk scans each input filename for lines that match any of a set of patterns specified in prog.
Example A.2.
1 awk '{print $1, $2}' file 2 awk '/John/{print $3, $4}' file 3 awk -F: '{print $3}' /etc/passwd 4 date | awk '{print $6}' |
EXPLANATION
|
Get UNIX® Shells by Example, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.