The file data.txt contains the following:
data.txt
1.00 1.23 54.4 213.2 3.4
The output of the scripts are supposed to be:
ave: 54.646
Some simple scripts are preferred.
Here is one method:
$ awk '{s+=$1}END{print "ave:",s/NR}' RS=" " file ave: 54.646
2.1m questions
2.1m answers
60 comments
57.0k users