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?