這是我的文件
air1.txt
fc:75:16:d2:91:a3 -90 targol
78:54:2e:7f:e8:9e -88 DLink
fc:75:16:d2:91:a3 -89 targol
78:54:2e:7f:e8:9e -89 DLink
78:54:2e:7f:e8:9e -88 DLink
78:54:2e:7f:e8:9e -87 DLink
fc:75:16:d2:91:a3 -90 targol
我要計算在第三列第二列的每個名稱平均!這是我的腳本!
RSSI=$(awk '{print $3}' air1.txt | sort -u | while read line; do awk < air1.txt '{print $2,$3}' | grep $line | ./rssiMean.sh |cut -d'.' -f1 |awk '{print $line,$1}' ;done)
echo $RSSI
但結果是
-88 -88 -89 -89
爲什麼我不能得到$line
?! BTW ./rssiMean.sh計算平均值!
這'AWK
Jotne
2014-10-29 06:36:21