|
我现在一个问题,不知大家有没有注意,我的icmp_seq是不连续的,如下
代码:
[code:1]
64 bytes from 192.168.100.40: icmp_seq=1 ttl=64 time=0.043 ms
64 bytes from 192.168.100.40: icmp_seq=2 ttl=64 time=0.033 ms
64 bytes from 192.168.100.40: icmp_seq=3 ttl=64 time=0.034 ms
64 bytes from 192.168.100.40: icmp_seq=5 ttl=64 time=0.034 ms
64 bytes from 192.168.100.40: icmp_seq=6 ttl=64 time=0.032 ms
64 bytes from 192.168.100.40: icmp_seq=7 ttl=64 time=0.034 ms
64 bytes from 192.168.100.40: icmp_seq=9 ttl=64 time=0.034 ms
64 bytes from 192.168.100.40: icmp_seq=10 ttl=64 time=0.038 ms
64 bytes from 192.168.100.40: icmp_seq=11 ttl=64 time=0.038 ms
64 bytes from 192.168.100.40: icmp_seq=12 ttl=64 time=0.028 ms
[/code:1]
我现在想在icmp_seq=3这行与icmp_seq=5 中间加上一行 request timeout,在icmp_seq=7这行与icmp_seq=9 中间加上一行 request timeout然后仍然以4行一组输出,如下:
代码:
[code:1]
64 bytes from 192.168.100.40: icmp_seq=1 ttl=64 time=0.043 ms
64 bytes from 192.168.100.40: icmp_seq=2 ttl=64 time=0.033 ms
64 bytes from 192.168.100.40: icmp_seq=3 ttl=64 time=0.034 ms
request timeout
64 bytes from 192.168.100.40: icmp_seq=5 ttl=64 time=0.034 ms
64 bytes from 192.168.100.40: icmp_seq=6 ttl=64 time=0.032 ms
64 bytes from 192.168.100.40: icmp_seq=7 ttl=64 time=0.034 ms
request timeout
64 bytes from 192.168.100.40: icmp_seq=9 ttl=64 time=0.034 ms
64 bytes from 192.168.100.40: icmp_seq=10 ttl=64 time=0.038 ms
64 bytes from 192.168.100.40: icmp_seq=11 ttl=64 time=0.038 ms
64 bytes from 192.168.100.40: icmp_seq=12 ttl=64 time=0.028 ms
[/code:1]
再扩展一下,icmp_seq是顺序显示的,我的目的就是将icmp_seq这个值没有出来的行用request timeout来替代.而且四行一组,的表示出来.!请高手帮忙.(注:上面ping值不是全部,而只是一小部分),如下:
代码:
[code:1]
64 bytes from 192.168.100.40: icmp_seq=1 ttl=64 time=0.043 ms
64 bytes from 192.168.100.40: icmp_seq=2 ttl=64 time=0.033 ms
64 bytes from 192.168.100.40: icmp_seq=3 ttl=64 time=0.034 ms
request timeout
64 bytes from 192.168.100.40: icmp_seq=5 ttl=64 time=0.034 ms
64 bytes from 192.168.100.40: icmp_seq=6 ttl=64 time=0.032 ms
64 bytes from 192.168.100.40: icmp_seq=7 ttl=64 time=0.034 ms
request timeout
64 bytes from 192.168.100.40: icmp_seq=9 ttl=64 time=0.034 ms
64 bytes from 192.168.100.40: icmp_seq=10 ttl=64 time=0.038 ms
64 bytes from 192.168.100.40: icmp_seq=11 ttl=64 time=0.038 ms
64 bytes from 192.168.100.40: icmp_seq=12 ttl=64 time=0.028 ms
request timeout
request timeout
64 bytes from 192.168.100.40: icmp_seq=15 ttl=64 time=0.038 ms
64 bytes from 192.168.100.40: icmp_seq=16 ttl=64 time=0.028 ms
...
[/code:1]
请高手帮忙!! |
|