NOTE: The problem is based on GUI program, so ordinary pipe won't work, I need keep both program running.
Preparation: In Redhat or Ubuntu, two gnome-terminal opened, terminal A is running a script program, which can generate some string output; terminal B is running another program, which is waiting user input.
Goal: Make the output of the terminal A/program be the input of Terminal B automatically.
The main challenge point is that, the program running in terminal B is beyond my control, it can only take some kind of specific user inputs via keyboard, I can not type any other pipe command while running it. Also, program B need some time to handle the command passed from program A, so if I have more than one command I need to keep both program RUNNING, but not like ordinary pipe: A generate series of command and terminated itself, all commands would be passed to B at the same time, B get input and response. If all commands come at the same time, B can only make response to the first one and ignore the rest.
Till now I have to copy the first program output and paste it into terminal B, is there any clever way to do link two terminal and make this operation automatically?