Skip to content

Instantly share code, notes, and snippets.

@tj
Created April 30, 2013 19:43
Show Gist options
  • Save tj/5491352 to your computer and use it in GitHub Desktop.
Save tj/5491352 to your computer and use it in GitHub Desktop.
awk utils
$ cat example.txt | sum
=> 10
$ sum example.txt
=> 10
alias sum="awk '{ sum += \$1 } END { print sum }'"
alias mean="awk '{ sum += \$1 } END { print sum / NR }'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment