Adding up columns of numbers- do you have stat(1G)

Steven Radtke sr at u1100a.UUCP
Sat Mar 30 05:57:19 AEST 1985


>>P.S. One strange omission (to my knowledge) from all the UNIX tools
>>is a program, similar in command syntax (groan, but probably needed)
>>to 'sort' which adds up columns of numbers:
>>
>>	sumcol +4.6 foo
>>
>>Strange, must have been written hundreds of times.
>
>Awk is great for this.  Something like: awk '{sum += $4}\\
>END {print sum}'
>	-mark

If you have graphics in /usr/bin, type "graphics"
and when you get the prompt "^" type 
"whatis" - surprise! user-friendly help messages from
UNIX that tell you what you need to know.
Other useful math utilities are available to users include:
mean and variance, powers, roots, exponentials, logs, rand, etc.

These commands are in UNIX 1100 and an ATT SysV UNIX I checked.
They are in /usr/bin/graf and they understand vectors.
A table usually has to be "cut" and piped to produce the vectors appropriate 
for the intended calculation.
Like a spreadsheet with a stick shift.
Have fun.

Steve Radtke
{ihnp4,houxm,pyux*}!u1100a!sr
Bell Communications Research, Inc.
Good Old New Jersey ---> seen Brooke Shields in our latest propaganda???



More information about the Comp.unix.wizards mailing list