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