Skip to content

Instantly share code, notes, and snippets.

@pontikos
Last active August 29, 2015 14:12
Show Gist options
  • Select an option

  • Save pontikos/4b62d64d863def0c5c6f to your computer and use it in GitHub Desktop.

Select an option

Save pontikos/4b62d64d863def0c5c6f to your computer and use it in GitHub Desktop.
Counts occurences of a field in output.
#! /usr/bin/awk -f
{
count[$1]++
}
END {
sort = "sort -n"
for(j in count)
print j, count[j] | sort
close(sort)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment