Skip to content

Instantly share code, notes, and snippets.

@flazz
Created October 8, 2014 12:29
Show Gist options
  • Save flazz/44bea586b7b06f9dcdd9 to your computer and use it in GitHub Desktop.
Save flazz/44bea586b7b06f9dcdd9 to your computer and use it in GitHub Desktop.
avg min max awk
BEGIN { min = 10000000000000; max = 0 }
{
sum += $1;
if ($1 < min) { min = $1 };
if ($1 > max) { max = $1 };
}
END {
print min, "\t", sum / NR, "\t", max;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment