I’ve got a server running inside a screen session, and I want to send this program a command. I thought screen -X was my answer, but all that gives me access to is screen commands (title, exec, etc).
I need to be able to send the command as if I was typing it into the program. Any ideas?
You may use
screen‘s-pand-Xoptions in conjunction with theexeccommand.Try
screen -X exec ".\!\!" echo foo, for example, to send “foo” to the currently-running program in the screen.You might also want to try
screen -X exec ".!" echo fooif the first command is not working.