[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] Pegar valores em posição determinada e calcular média
From: |
Felipe Kellermann |
Subject: |
Re: [shell-script] Pegar valores em posição determinada e calcular média |
Date: |
Thu, 4 May 2006 21:40:42 -0300 (BRT) |
User-agent: |
Pine <http://www.washington.edu/pine/> |
On Thu, 4 May 2006 4:08pm -0300, Tiago Barcellos Peczenyj wrote:
> # comparando com a versão em AWK
> $ cut -c6-8 txt | awk '{A += $0} END {print A/NR}'
> 3.71429
>
> # legal... :)
Ola! Se for para aumentar a precisao, da para usar OFMT (e eu acho muito
mais legal sem usar o cut :-))
--
Felipe Kellermann