Shell GNU-Screen -X Material Problems

OPTIONS="java -Xms1024M -Xmx1024M -jar craftbukkit.jar" PROCESS=server01 screen -dmS $PROCESS $OPTIONS nogui # Starting the application screen -x $PROCESS -X stuff `printf "stop\r"` # Closing the application screen -x $PROCESS # Attaching to the terminal of the application 

The application works fine from the very beginning, but I'm having problems with stuff 'printf "stop/r"' It doesn't seem to work when I just start, wait a while, and then try to stop it using the command above. But it’s strange that if I made screen -x $PROCESS and disconnected ( ctrl-A & ctrl-D ), then I used the Stop command in which it works. So, is there a way stuff printf without screen -x $PROCESS ?

+7
source share
1 answer

Adding the -p 0 argument should fix it. Something like that:

 screen -x $PROCESS -p 0 -X stuff `printf "stop\r"` 

(From the screen documentation: -p window Pre-select the named window, if one exists.)

+16
source

All Articles