1834809 Members
2607 Online
110070 Solutions
New Discussion

ping

 
SOLVED
Go to solution
Ralf Buchhold
Regular Advisor

ping

Hello
I want to seperate the second line from the ping result to an variable:

PING XXXXXX: 64 byte packets
64 bytes from 172.30.200.60: icmp_seq=0. time=0. ms --> THIS IN A VARIABLE

----XXXXX PING Statistics----
1 packets transmitted, 1 packets received, 0% packet loss
round-trip (ms) min/avg/max = 0/0/0

How does it works ?
Thanks Ralf
1 REPLY 1
Geoff Wild
Honored Contributor
Solution

Re: ping

MYVAR=`ping XXXXXX -n 1 |grep icmp`

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.