Link to home
Start Free TrialLog in
Avatar of jjc_mn
jjc_mn

asked on

doing math in a bash script.

I'm grepping a file and getting a list of about a thousand numbers that I need to average and total.. The numbers are not big. The numbers I'm trying to add and average will be between 0 and 10000. What's the best way to average and add these numbers in a bash script?  I know I can send the list to a new file and read though it and do the math but I was hoping there might be a way to avoid creating a temp file. Any ideas?
ASKER CERTIFIED SOLUTION
Avatar of egarciat
egarciat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jjc_mn
jjc_mn

ASKER

I'll give this a try when I can. Thanks!