Here's something that will work.
# Compute the average of the numbers in file 'input'
for i in `sed -n p input`
You can name this file "avg". Then, place all the numbers you want to average in a file called "input", but make sure that there is only one number appearing on each line. For example, you could have a file "input" with the contents
And if you named your script "avg", and in the same directory you have the file "input" with the above contents, then from this directory can type
and the number 3 should be printed to the terminal.