title: linux screen detatch and logout
body: <p>i love screen utility and i use it extensively on my server so i set up my .bashrc file to resume my screen session on login. the only function i am missing is something that logs out from the ssh session without the need of detaching/closing the screen session explicitly.</p>
  
  <p>i was thinking about some script that would run <code>screen -dS "mainScreen"; exit</code> but it is not possible as this script obviously continues its execution inside the screen session after the detach instruction and does not affect my ssh session, so the only thing i get is that the screen session is terminated.</p>
  
  <p>is there a way to do the 'detatch and exit' action atomically leading the screen to continue running and my ssh session to terminate?</p>