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 p开发者_运维知识库rogram. Any ideas?
You may use screen
's -p
and -X
options in conjunction with the exec
command.
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 foo
if the first command is not working.
精彩评论