Hi,
I am trying to parse mtr stats.
On each hop if Loss > 0 then I need to email the entire stats.
IFS='
';for i in `cat mtrres `; do VAL=$(echo $i|awk -F" " '{print $2}' | awk -F"." '{print $1}'); if [ $VAL -ne 0 ]; then echo "send email"; exit 0; fi;done
Filename: mtrres
192.168.1.10 Snt: 10 Loss% Last Avg Best Wrst StDev
192.168.1.1 0.0% 6.5 3.0 0.5 8.4 3.2
ge-11-0-0-xcr1.nyk.cw.net 0.0% 0.3 0.3 0.2 0.3 0.0
ge-11-0-0-xcr1.nyk.cw.net 0.0% 57.1 61.1 57.1 75.4 6.3
ir1.fp.vip.gq1.yahoo.com 0.0% 58.5 58.2 58.1 59.0 0.3
Please advise if there is a better way... It helps me and someone who is looking..
Thanks
Ashok