[olug] One-liner adding machine

olug at wjjeep.com olug at wjjeep.com
Mon Feb 6 19:52:01 UTC 2006


On Mon, Feb 06, 2006 at 01:28:51PM -0600, Jay Hannah wrote:
> [SNIP]
> 
> Let's see your alternate syntaxii, shell gurus :)

Using awk:
[olug ~]$ cat test
a,aa,1
b,bb,20
c,cc,3
d,dd,40

[olug ~]$ awk -F"," '{total += $3}; END{print total}' test
64

Phil




More information about the OLUG mailing list