PDA

View Full Version : [SOLVED] Screen and sending commands to sessions



Fenlig
September 10th, 2011, 03:45 PM
Hey Guys,

Okay so Im writing a script in bash which will send a command to a detached session named mine_server, but when ever I run the command it sends it to the session but does not execute it.

Command I run: minecraft@Servertron:~$ screen -S mine-server -X stuff hello

And this is what I see on the session: minecraft@Servertron:~$ hello

I've looking over this tutorial and cannot see where I am going wrong:
http://www.jerri.de/blog/archives/2006/05/02/scripting_screen_for_fun_and_profit/

Any Ideas?

Toz
September 10th, 2011, 06:44 PM
Try this:

screen -S mine-server -X stuff hello$'\n'

The $'\n' will send the return sequence as well.