Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.unix.questions Subject: Re: What's wrong with this Bourne shell script? Message-ID: <1990Aug14.171056.17982@iwarp.intel.com> Date: 14 Aug 90 17:10:56 GMT References: <1990Aug6.172225.20319@iwarp.intel.com> <850@jonlab.UUCP> <9116@jpl-devvax.JPL.NASA.GOV> <1474@chinacat.Unicom.COM> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 24 In-Reply-To: fpb@ittc.wec.com (Frank P. Bresz) In article , fpb@ittc (Frank P. Bresz) writes: | >or if you have Jon's addcol, even simpler: | | > stat -s * | addcol -2 | | Where is Jon's addcol. I tried to write one a while back and kept | screwing it up. I would like to see a working version. for addcol -1, try: perl -ane '$s += $F[0]; print "$s\n" if eof;' for addcol -2: perl -ane '$s += $F[1]; print "$s\n" if eof;' Others may be derived by noticing the pattern. :-) Just another Perl hacker, -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/