title: Sending SIGINT to foreground process works but not background
body: <p>I have two scripts. <em>script1</em> spawns <em>script2</em> and then sends a <code>SIGINT</code> signal to it. However the trap in <em>script2</em> doesn't seem to work?!</p>
  
  <p>script1:</p>
  
  <pre><code>#!/bin/bash
  ./script2 &amp;
  sleep 1
  kill -SIGINT $!
  sleep 2
  </code></pre>
  
  <p>script2:</p>
  
  <pre><code>#!/bin/bash
  echo "~~ENTRY"
  trap 'echo you hit ctrl-c, waking up...' SIGINT
  sleep infinity
  echo "~~EXIT"
  </code></pre>
  
  <p>If change <code>./script2 &amp;</code> to <code>./script2</code> and press <code>CTRL+C</code> the whole things works fine. So what am I doing wrong?</p>