ping 192.168.63.121
PING 192.168.63.121: 56 data bytes, press CTRL_C to break
Reply from 192.168.63.121: bytes=56 Sequence=1 ttl=60 time=4 ms
Reply from 192.168.63.121: bytes=56 Sequence=2 ttl=60 time=14 ms
Reply from 192.168.63.121: bytes=56 Sequence=3 ttl=60 time=1 ms
Reply from 192.168.63.121: bytes=56 Sequence=4 ttl=60 time=2 ms
Reply from 192.168.63.121: bytes=56 Sequence=5 ttl=60 time=1 ms
--- 192.168.63.121 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/4/14 ms
<h3c>
Can I get the "0.00% packet loss"? I want to know peer ip is alive or not.
now my code as following:
$consoleprompt = 'yes\/no|assword|[\$#>\]]$|[\$#>\]] $|>.$|].$'; $ssh->send("ping $ip"); $ssh->waitfor($consoleprompt,5); $prematch=$ssh->before(); $ssh->waitfor($consoleprompt,5);
In reply to How to use "$ssh->before()" by hxbsy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |