Unix script to calculate average of n numbers given by user?
You really don't want to do this in a shell script - scripting
languages in Unix typically do not handle or work with floating
values, only integers. A better way would be to write a program to
do this that works under Unix, such as a 'C" program.
See the related link for an example