Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!ittc!fpb From: fpb@ittc.wec.com (Frank P. Bresz) Newsgroups: comp.unix.questions Subject: Re: What's wrong with this Bourne shell script? Message-ID: Date: 16 Aug 90 04:54:19 GMT References: <1990Aug6.172225.20319@iwarp.intel.com> <850@jonlab.UUCP> <9116@jpl-devvax.JPL.NASA.GOV> <1474@chinacat.Unicom.COM> <1990Aug14.171056.17982@iwarp.intel.com> Sender: news@ittc.wec.com Reply-To: fbresz@ittc.wec.com Organization: Westinghouse, ITTC, Pgh, PA. Lines: 32 In-reply-to: merlyn@iwarp.intel.com's message of 14 Aug 90 17:10:56 GMT In article <1990Aug14.171056.17982@iwarp.intel.com> merlyn@iwarp.intel.com (Randal Schwartz) writes: >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, That would be fine if I had or wanted pearl. I was under the impression that Jon's addcol was an awk script (I think that's where the original thread came from anway) in which the -# was the column you wanted to add and it would magically add up the numbers in column 1 or 7 or whatever column you wanted under argumentalized control instead of having separate scripts for each possible set of columns you want to add. -- +--------------------+ |fbresz@ittc.wec.com | My opinions are my own, I'm not paid |uunet!ittc!fbresz | enough to make an official statement |(412)733-6749 | +-----------------------------------+ |Fax: (412)733-6444 | | THIS SPACE FOR SALE!!! | +--------------------+ +-----------------------------------+