cat > temp0001
80
25
57
98
95
78
92
18
77
19
awk '{x[NR]=$0; s+=$0; n++} END{a=s/n; for (i in x){ss += (x[i]-a)^2} sd = sqrt(ss/n); print "SD = "sd}' temp0001
SD = 30.3857
cat > temp0001
80
25
57
98
95
78
92
18
77
19
awk '{x[NR]=$0; s+=$0; n++} END{a=s/n; for (i in x){ss += (x[i]-a)^2} sd = sqrt(ss/n); print "SD = "sd}' temp0001
SD = 30.3857
转载于:https://www.cnblogs.com/emanlee/p/4556324.html