Skip to content

Instantly share code, notes, and snippets.

@rosado
Created April 29, 2013 12:03
Show Gist options
  • Save rosado/5481196 to your computer and use it in GitHub Desktop.
Save rosado/5481196 to your computer and use it in GitHub Desktop.
Useful bash functions
function histogram () {
awk ' NF > 0{ counts[$0] = counts[$0] + 1; } END { for (word in counts) print word, counts[word]; }'
}
function awk-average () {
awk '{ s+=$1 } END { print 's/NR' }'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment