title: sh screen - Wait for screen to terminate
body: <p>I'm writing on a little script that does send a command to a running screen session. This command stops the screen but not instantly. I need to wait for it to finish in order to continue with the rest of the script.</p>
  
  <p>This is how I stop the screen:</p>
  
  <pre><code>screen -S $SCREEN_NAME -p 0 -X stuff "`printf "stop\r"`"
  </code></pre>
  
  <p>How could I do this?</p>