#!/usr/bin/env awk -f
#
# linecheck - report lines exceeding 80 characters in files
# usage: linecheck file1 file2 ...
#
# one-liner:
# awk '{ if (length>96) printf "%s:%-4d %d\n", FILENAME, NR, length }' "$1"
#
# ----
# source: https://github.com/woodruffw/snippets

BEGIN {
    max = 80
}

{
    if (length($0) > max)
    {
        printf "%s:%d exceeds %d characters.\n", FILENAME, FNR, max
    }
}

END {
    exit 0
}
