Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created October 30, 2013 16:46
Show Gist options
  • Save ableasdale/7235967 to your computer and use it in GitHub Desktop.
Save ableasdale/7235967 to your computer and use it in GitHub Desktop.
Pulling some number values out of a text file and creating a total from all items found.
grep "STRING" FILENAME | cut -d " " -f4 | awk '{total = total + $1}END{print total}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment