1. program structure
BEGIN {awk-commands}
/pattern/ {awk-commands} // body
END {awk-commands}
2. variable
$0: a special variable in awk that represents the entire line
3. commands
awk -f command.awk marks.txt
awk '/a/{++cnt} END {print "Count = ", cnt}' marks.txt
No comments:
Post a Comment