How to run a program on a different screen session?

I want to run the program on a different screen session.

Let's say I run a screen like this

screen -S asti

And then I want to create a new window in this session. This is easy enough:

screen -S "asti" -X "screen"

In this session, two windows are created.

How to run the program on this screen session?

I tried:

screen -S "asti" program

Does not work

I tried the -p flag ... and many other attempts were made, but I did not.

Can anyone help me out?

Thanks in advance for your help and care.

+4
source share
1 answer

If you want to start a new window in an existing screen session on which a specific command is running, you want to use

screen -S asti -X screen 'command'

, stuff, "" .

screen -S asti -p # -X stuff $'text to enter\n'
+3

Source: https://habr.com/ru/post/1569078/


All Articles