aboutsummaryrefslogtreecommitdiff
path: root/bin/max.awk
blob: f6b84eada7107e9f540991b4c6e4d7e2fba22182 (plain) (blame)
1
2
3
4
5
6
7
8
# Get the maximum of a list of numbers
BEGIN { max = 0 }
NR == 1 || $1 > max { max = $1 + 0 }
END {
    if (!NR)
        exit(1)
    print max
}