Created
September 29, 2015 00:49
-
-
Save ddunkin/9bc7e2962909b3c8e829 to your computer and use it in GitHub Desktop.
ruby sum first column from stdin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby -e 'sum = 0 ; ARGF.each_line { |l| sum = sum + l.split.first.to_i } ; puts sum' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment