Intro Summary (The GNU Awk User’s Guide)
From Get docs
Gawk/docs/latest/Intro-Summary
Previous: When, Up: Getting Started [Contents][Index]
1.9 Summary
- Programs in
awkconsist ofpattern–actionpairs. - An
actionwithout apatternalways runs. The defaultactionfor a pattern without one is ‘{ print $0 }’. - Use either ‘
awk 'program' files’ or ‘awk -f program-file files’ to runawk. - You may use the special ‘
#!’ header line to createawkprograms that are directly executable. - Comments in
awkprograms start with ‘#’ and continue to the end of the same line. - Be aware of quoting issues when writing
awkprograms as part of a larger shell script (or MS-Windows batch file). - You may use backslash continuation to continue a source line. Lines are automatically continued after a comma, open brace, question mark, colon, ‘
||’, ‘&&’,do, andelse.