What's wrong with this Bourne shell script?
Randal Schwartz
merlyn at iwarp.intel.com
Thu Aug 16 17:37:29 AEST 1990
In article <FPB.90Aug16005419 at ittc.ittc.wec.com>, fpb at ittc (Frank P. Bresz) writes:
| 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.
Well, the script in awk is almost as easy:
... | awk '{ $x += $3 }
END { print $x }' |
who needs anything else? (But in Perl you can write it in one line. :-)
Just another Perl hacker, more-or-less,
--
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III |
| merlyn at iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/
More information about the Comp.unix.questions
mailing list