My scenario is this:
I have a screen session running in a remote location. Inside this screen is a consoled-based program. When run without screen, this program starts in the terminal and accepts commands on its standard input.
What I want is a way to remotely send a command to screen so that this command is received by the console program. Maybe like this:
My PC -> SSH Send Msg Auto -> Screen Session -> Program (Run command received)
So from a remote PC I can send via SSH commands to the screen which sends them to the program. The program accepts them and executes them.
stuff
sends characters, exactly as if you had typed them. What exactly did you try, what was the intended effect, and what happened instead? – Gilles 'SO- stop being evil' Jan 01 '11 at 19:59-p
is necessary (or at least a good idea) if there is more than one window. To “press Enter”, just include a newline in the argument (i.e. inside the quotes), as I've done. – Gilles 'SO- stop being evil' Jan 01 '11 at 21:00-p
is also necessary if you have just created a session without attaching to it, because no window is selected by default. – Chris Down Nov 18 '12 at 03:46