这是我的文件
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