I have a Java app running in a screen session (A game server), and I'd like to be able to write a script to send commands to it periodically (with cron probably), but I'm not sure how to send commands to a running screen session.
Is this possible? Might be complicated by the fact that I'm not just sending more shell commands to the screen, but putting text into the running Java console.
Best Answer
Try this example from screen faq:
It will run
top
command in the screen session namedtest
.^M
is a control character you can put by pressingCTRL+V, ENTER
in bash.