title: Exec a running process
body: <p>I currently have a Bash script that uses <code>exec</code> at the end to spin up a running server process:</p>
  
  <pre><code>#! /bin/bash
  .
  .
  .
  exec python -m SimpleHTTPServer 8080
  </code></pre>
  
  <p>But now, instead of just <code>exec</code>-ing the command, I'd like to "warm up" the server process before <code>exec</code> squashes my calling shell program. Kind of like:</p>
  
  <pre><code>#! /bin/bash
  
  python -m SimpleHTTPServer 8080 &amp;
  
  for index in $(seq 100); do
      curl -X GET http://localhost:8080/warm/up
  done
  
  # =&gt; How can I exec when my command is already running?
  </code></pre>
  
  <p>As I understand it, <code>exec</code> can only take a command, but not a running process PID or something.</p>
  
  <p>I really don't want to leave a calling Bash shell as the parent of my <code>python</code> server in this case, to avoid any signal-handling pitfalls in the parent.</p>