开发者

Sending commands to the active program in a screen session?

开发者 https://www.devze.com 2023-01-11 07:16 出处:网络
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'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.

0

精彩评论

暂无评论...
验证码 换一张
取 消