So there is a common problem that I have found in bash. Let’s say you start a program X and you want to either wait until it has completed or until it has loaded before initiating program Y. What is the pattern for doing this?
Just thinking… I guess you could do X && Y in the case that you’re waiting for X to complete. But I still don’t know about what to do in order to determine if the program X has “loaded”. (And I know I’m using “loaded” very generically here, so tell me if I need to be more specific.)
Loaded – should mean that the program has reached “the state” that I’m looking for and has somehow left evidence, for instance by creating a “loaded” file as a token (which it will presumably remove upon shutdown). So how then do I check in bash to see if that token exists. Do I write a while look that checks for it’s existence indefinitely and then completes only upon finding the “loaded” token?
Why not just call something like
X && checkIfXLoaded && Y?