From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "E. Richard Glazier" Newsgroups: gmane.os.tru64.managers Subject: SUMMARY vi math problem Date: Wed, 29 May 2002 18:54:46 +0000 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed Content-Transfer-Encoding: 8BIT X-Trace: main.gmane.org 1022698460 12406 127.0.0.1 (29 May 2002 18:54:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 29 May 2002 18:54:20 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.33 #1 (Debian)) id 17D8aS-0003Dz-00 for ; Wed, 29 May 2002 20:54:20 +0200 Original-Received: (qmail 29758 invoked by uid 5); 29 May 2002 18:54:56 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 29750 invoked from network); 29 May 2002 18:54:56 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (134.167.3.119) by 0 with SMTP; 29 May 2002 18:54:56 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.1 #39060) with ESMTP id <0GWV00MSMZ7I9D@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 29 May 2002 14:54:55 -0400 (EDT) Original-Received: from hotmail.com (f147.law4.hotmail.com [216.33.149.147]) by emroute1.cind.ornl.gov (PMDF V6.1 #39060) with ESMTP id <0GWV00CMTZ7BPM@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 29 May 2002 14:54:47 -0400 (EDT) Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 29 May 2002 11:54:46 -0700 Original-Received: from 63.93.126.51 by lw4fd.law4.hotmail.msn.com with HTTP; Wed, 29 May 2002 18:54:46 +0000 (GMT) X-Originating-IP: [63.93.126.51] Original-To: tru64-unix-managers@ornl.gov X-OriginalArrivalTime: 29 May 2002 18:54:46.0989 (UTC) FILETIME=[4D8987D0:01C20742] Xref: main.gmane.org gmane.os.tru64.managers:367 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:367 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