passing commands to screen

  • So I'm getting to the point where I'm going to have to start automating some tasks. i need to be able to pass console commands to the game. I'm just having trouble getting it to work. I tried a few examples on stackoverflow and by following the stop section of linux_startup.sh


    screen -S <myscreen> -X yell this is a test
    screen -S <myscreen> -X "yell this is a test"
    screen -S <myscreen> -X yell this is a test\r
    screen -S <myscreen> -X "yell this is a test\r"
    screen -S <myscreen> -X "yell this is a test$(printf \\r)"


    Any suggestions? none of the above are executed in rising world. What I'm trying to do is sent a warning message to everyone before restarting the server. I'm going to attach this to a cron job eventually.

  • Ok.. nvm I just got it to work but I'll share the answer in case anyone else runs into it too. There's a special command in screen that I just overlooked it because i figured it was just part of an example command on stack overflow.



    screen -S <the screen id> -p 0 -X stuff "yell another test\r"


    So "stuff" is actually a command that "stuffs" the string into stdin. Otherwise it goes... i don't know where.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!