-2
Code:
if [ 'ping $1 -c1 |grep rtt |awk {'print$4'} |awk -F "/" {'print$2'}' -gt 0 ]
then
echo "OK"
else
echo "NO OK"
fi
Error:
./latencia.sh: line 1: [: ping $1 -C1 |grep rtt |awk {print} |awk -F "/" {print}: expected integer expression NO OK
If I understand your command, you are determining the average time of
ping
for a particular machine. (1) is not expected to be less than or equal to zero... (2) -gt makes comparison between integers (3) the quotation around the big comandi is exchanged.– JJoao