Created
July 3, 2010 00:52
-
-
Save elder/462150 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
# | |
# Programa para calcular média e desvio padrão em awk | |
#----------------------------------------------------------------------- | |
{ | |
soma+=$1 | |
somaquad+=$1*$1 | |
} | |
END { | |
media=soma/NR | |
desvpad=sqrt((somaquad - NR*media**2)/(NR - 1)) | |
printf "%.1f(%.1f)\n", media, desvpad | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment