title: How to enter keyboard shortcuts in bash script
body: <p>Is it possible to enter keyboard shortcuts into a bash script? For example, I have tried typing in <code>^d</code> to substitute for control + d (logout) without success.</p>
  
  <pre><code>ubuntu@vfleet:~$ ^d
  -bash: :s^d: substitution failed
  ubuntu@vfleet:~$ ^D
  -bash: :s^D: substitution failed
  </code></pre>
  
  <p>I am using <a href="https://www.gnu.org/software/screen/manual/screen.html" rel="nofollow noreferrer">screen</a> to run a django development server in the background. One of the commands to run a particular screen as a daemon is control + a + d. The goal is to be able to enter in control + a + d into a bash script. For example:</p>
  
  <pre><code>python manage.py runserver
  ^a + d
  </code></pre>
  
  <p>Is this possible?</p>
  
  <p><strong>Edit:</strong>
  A valid method of avoiding the keyboard shortcut in screen is linked by Eric Renouf in the comments below. <code>screen -d -m sh -c "python manage.py runserver"</code> will start a development server as a daemon. This is a great solution for my particular problem, but it would still be nice to have a solution for the original question at hand.</p>