Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

bits 11

shell tooling #awk #linux #gawk
  • Awk is executed using awk 'awk_program' data-file.
  • Awk programs follow the form pattern { action }; pattern { action };.
  • BEGIN blocks are executed before reading the data files.
  • END blocks are executed after reading the data files.
  • NR is a variable that indicates the number of records (rows) read so far.
  • -F '<separator>' is used to define a field separator for a file.
  • A space is the default field separator.
  • FPAT is a regex used to define the pattern for each field.
  • FPAT is specifically defined in Gawk.