Sending input to a screen session from outdoors

My circumstance is this:

I have a screen session running in a remote area. Inside this screen is a gaming consoled - based program. When run without screen, this program begins in the incurable and also approves commands on its typical input.

What I desire is a means to from another location send a command to screen to make sure that this command is obtained by the console program. Possibly similar to this:

My COMPUTER - > SSH Send Msg Auto - > Screen Session - > Program (Run command obtained)

So from a remote COMPUTER I can send using SSH regulates to the screen which sends them to the program. The program approves them and also implements them.

2019-05-13 05:06:17
Source Share
Answers: 1

If I recognize appropriately, you intend to send input to a program running inside a screen session. You can do this with screen is stuff command. Usage screen is -X alternative to execute a command in a screen session without affixing to it.

screen -S sessionname -p windowname -X stuff 'command1

If you intend to see the program is result, see the hardcopy, log and also logfile commands.

2019-05-17 19:24:46