title: In Tcl on Unix, how do I kill a background process that has been launched with exec?
body: <p>I would like to launch a Unix background process from within a Tcl program by using Tcl's exec command. However, I'd like to programmatically kill the background process from the same Tcl program at some arbitrary time in the future. How can I best accomplish this?</p>
  
  <pre><code>bash$ cat loop.bash
  #!/bin/bash
  while [ 1 ]; do sleep 5; done;
  
  bash$ tclsh
  
  % exec /home/dana/travis/loop.bash &amp;
  6598
  
  % puts "How do I kill the background process started by the previous exec command?"
  How do I kill the background process started by the previous exec command?
  
  %
  </code></pre>