title: Using environment variables in commands passed to screen
body: <p>To execute a command in a detached screen I can do this (after creating a screen, <code>screen -dmS myscreen bash</code>):</p>
  
  <pre><code>screen -S myscreen -X stuff $'echo hello\n'
  </code></pre>
  
  <p>However this syntax messes with <code>$</code> for environment variables:</p>
  
  <pre><code>MSG="hello"
  screen -S myscreen -X stuff $'echo $MSG\n' #doesn't work
  </code></pre>
  
  <p>What can I do instead?</p>