title: Shell GNU-Screen -X Stuff problems
body: <pre><code>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
  </code></pre>
  
  <p>The application works fine at the start, however I get problems with <code>stuff 'printf "stop/r"'</code>
  It seems not to work when I just start up, wait some time and then try to stop it with the command above. But the strange thing is, that if I did <code>screen -x $PROCESS</code> and detach (<code>ctrl-A &amp; ctrl-D</code>) and then I use the <code>Stop</code> command it does work. So is there a way around to <code>stuff printf</code> without <code>screen -x $PROCESS</code>?</p>