Let's say I have one command window open, and it's running some Java application, regularly outputting text.If I wanted to send a command to it, I could just type it in and press enter.But how could I automate this? If there's some command to send a command to an open window, then I could put that into a .sh with a timer.
Sending command to second shell
shell
You can run things under screen to automate stuffing input to applications.  I have scripts in Python to make it easier to start a command in the background and stuff input (with control character encoding to let you do things like '\r' or '^c') to any screen sesssion (open or background).