Skip to content

Instantly share code, notes, and snippets.

@nahakiole
Created October 2, 2014 15:55
Show Gist options
  • Save nahakiole/26820cdfd2db216b1455 to your computer and use it in GitHub Desktop.
Save nahakiole/26820cdfd2db216b1455 to your computer and use it in GitHub Desktop.
Add all numbers from a file seperated by line break
cat file | grep -Eo "[0-9]+" | tr '\n' '+' | rev | cut -c 2- | rev | bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment