Wait for command to complete?

Hello,

I’m sure this question has been asked before, but I can’t work out a search that provides relevant results

So I have the following command

{
:execute {ping 10.0.0.1 interface="bridge / LAN" interval="1000ms" count=30} file=ping.txt
}

The ping takes time to execute, is there a way that I can monitor for when the ping has completed, or can I only use some arbitrary delay?

I want to read the file once the ping has completed

Thanks

VW

You could try

{
:execute {   ping 10.0.0.1 interface="bridge / LAN" interval="1000ms" count=30; /file print file=pingdone.txt; } file=ping.txt
}

Then in your later code, or other code where you are waiting, just look for the existence of pingdone.txt which will only be created after the ping is complete. This testing can be done with a :len and a find

That works great.

Thanks!