{ "name": "awk", "section": 1, "title": "pattern scanning and processing language", "synopsis": [ "awk [OPTION]... [OPERAND]..." ], "description": "Pattern-directed scanning and processing. Engine in lib/awk-engine.js; Issue 7–oriented subset (BEGIN/END, patterns, arrays, printf, POSIX math builtins atan2/cos/sin/exp/log/sqrt, getline from stdin or file via getline var < path, next/nextfile, delete). See handbook ch.9 §7 for lexer and timing divergences.", "options": [], "keywords": [ "awk", "pattern", "field", "script" ], "seeAlso": [ { "name": "sed", "section": 1 }, { "name": "grep", "section": 1 } ], "bareOsNotes": "See handbook ch.9 for divergence from Issue 7.", "examples": [ { "caption": "print column 1", "code": "awk '{print $1}' file.txt" }, { "caption": "field separator", "code": "awk -F: '{print $1}' /etc/passwd" }, { "caption": "sum numbers in first column", "code": "awk '{s+=$1} END{print s}' nums.txt" }, { "caption": "lines matching /re/", "code": "awk '/error/{print NR\": \"$0}' log.txt" } ] }