tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY vi math problem
@ 2002-05-29 18:54 E. Richard Glazier
  0 siblings, 0 replies; only message in thread
From: E. Richard Glazier @ 2002-05-29 18:54 UTC (permalink / raw)


Thanks so much to everyone (and I think everyone resonded!). This was very 
educational to me. I need to become more fluent in awk.

Most evryone had an awk solution that went something like this:

>awk '{sum+=+1} END {print sum}' filename


A way to sum each line as you add them, with the total as the additional
last line:

>awk {'print sum += $1'} filename


Here was a pretty slick example of using awk that way"

>ls -l | awk '{sum+=5} END {print sum}'

This totals the file sizes in that directory.


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-05-29 18:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-29 18:54 SUMMARY vi math problem E. Richard Glazier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox