I'm trying to run an emulator remotely.
Manually:
I open three terminals (usually as tabs in mate-terminal, but that's not important)
In the first, I run 'startemulator'.
In the second, I run 'startuart'. This terminal needs to stay live, as it gives two-way communication to the emulated device over it uart.
Then I have to wait until the emulated device prints [RDY] over its uart. This takes about 10 minutes, but the time is variable.
Only then can I run 'starthost' in the third terminal. Followed by some other commands which are always the same, including logging in to the host machine. If I do this too early, before the device is ready, all hell breaks loose.
Once this is done, I end up with three terminals, all of which are independently useful.
How can I automate this process (without rejigging all the underlying scripts, which aren't under my control, and which other people depend on)?
I'd like to be able to type 'go', and then go and make a cup of coffee and come back to find it all three terminals set up and waiting for me.
I know that I can use 'expect' for the command sequence in the third terminal, but I don't know how to make it wait for something to be printed in another terminal. I could use a delay, but that's kludgy and fragile.