title: Starting screen in detached mode doesn't source environment
body: <p>I would like to start <code>screen</code>sessions in a detached state so that they terminate once the script finishes <strong>and</strong> so that I can write a script to execute multiple <code>screen</code> sessions without me having to manually, one by one, start each session and then detach, before moving onto to the next screen session.</p>
  
  <p>This script depends on certain environment variables being set. Normally, when I run this script outside of <code>screen</code>, in a regular <code>bash</code> shell, I simply have these environment variables set in my <code>.bash_profile</code> file.</p>
  
  <p>Furthermore, when I start screen in a non-detached state and put in my <code>.screenrc</code> file:</p>
  
  <p><code>shell -$SHELL</code></p>
  
  <p>then I also have no problems.</p>
  
  <p>The issue only arises when I perform <code>screen -dm</code> then my script fails to run as the environment I need is not set.</p>
  
  <p>How can I tell screen to refer to the <code>.screenrc</code> file when starting in a detached state such that it ultimately sources my <code>.bash_profile</code> on startup?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>When I perform <code>screen -dmL env</code> I can see that some but not all of my environment variables are present.</p>