What's wrong with this Bourne shell script?
Frank P. Bresz
fpb at ittc.wec.com
Thu Aug 16 14:54:19 AEST 1990
In article <1990Aug14.171056.17982 at iwarp.intel.com> merlyn at iwarp.intel.com (Randal Schwartz) writes:
>In article <FPB.90Aug13191108 at ittc.ittc.wec.com>, fpb at 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 at 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!!! |
+--------------------+ +-----------------------------------+
More information about the Comp.unix.questions
mailing list