I am new to expect programming. In my script i need to run multiple ping commands.
I am running below mentioned command: ping $ip rep 100 size 1500
If connection is successful than its all good, but if ping response will not come, then it will keep pinging device till 100 rep, which is taking a lot of time. I want to break it in between and switch to next command if i got output of command like this:
Type escape sequence to abort. Sending 100, 1500-byte ICMP Echos to $ip, timeout is 2 seconds: .......
I have tried breaking it with regex and different ASCII codes, but every other option is working only after 100 pings to device.
Any help would be appreciated.