The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-27-2009
Rhije Rhije is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 103
Oh thats an easy one. There is also 'bc' but that would be for really hard core math, and then there is "let".. but dont worry with those.. you can just use awk.


Code:
-bash-3.2$ cat test.txt
one 1
two 2
three 3
four 4
five 5
six 6
seven 7
eight 8
nine 9
ten 10

-bash-3.2$ awk '{count += $2;} END { print count; }' test.txt
55