views:

18

answers:

1

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?

A: 

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.

Borealid
I've been all over that damn manual, it hasn't helped me at all.
Dragonshadow
@Dragonshadow: I had pity on you. Command attached.
Borealid
I get "Cannot exec '.\!\!': No such file or directory"The entire exec section made no sense to me
Dragonshadow
And removing the quotes around .\!\! makes it do nothing at all
Dragonshadow
Fidling around with it some more got it to work, thank you!
Dragonshadow