I'm attempting to create a detached screen and then send it a command, but this doesn't seem to be working.
If I enter the following commands:
$ screen -ls No Sockets found in /var/run/screen/S-ec2-user. $ screen -dmS myscreen $ screen -ls There is a screen on: 9175.myscreen (Detached) 1 Socket in /var/run/screen/S-ec2-user. $ screen -S myscreen -X ls
Then I attached to the screen to see if the command executed:
$ screen -r myscreen
All I get is a blank command-line, as if nothing happened.
Does anyone know why this is failing, and what commands I can use to actually get the command to run inside the screen?
Note: I want to stay detached from the screen if possible, and just send commands into the screen from outside. This is because my plan is to run multiple screens, using an automated means (e.g. bash script).