moonlight1
MIS
Hi all,
I have an input file contaning the following string:
"--- 100.100.100.1 ping statistics ---
5 packets transmitted, 5 received, 0% loss, time 4003ms
rtt min/avg/max/mdev = 0.711/0.939/1.716/0.391 ms"
From my bash script i would like to capture the loss (%) precent valu from the file above.
i've tried doing it with this sed format but it didn't work:
sed 's/^.*received, \([^;]*\);.*/\1/g'
Anyone please could advise how to capture the loss value using sed or anything else which could be more appropriate here.
thanks allot.
I have an input file contaning the following string:
"--- 100.100.100.1 ping statistics ---
5 packets transmitted, 5 received, 0% loss, time 4003ms
rtt min/avg/max/mdev = 0.711/0.939/1.716/0.391 ms"
From my bash script i would like to capture the loss (%) precent valu from the file above.
i've tried doing it with this sed format but it didn't work:
sed 's/^.*received, \([^;]*\);.*/\1/g'
Anyone please could advise how to capture the loss value using sed or anything else which could be more appropriate here.
thanks allot.