title: Need to append output from the python script to the file
body: <p>I'm trying to write a simple <code>shell</code> script to start and stop my python script. The reason I'm doing this is because I want to use tool called <code>monit</code> to monitor processes and I also would need to be sure that this script is running. So here is my python script:</p>
  <h1>test.py</h1>
  <pre><code> import time
   
   for i in range(100):
       time.sleep(1)
       print 'a'*i
  </code></pre>
  <p>and here is my shell script:</p>
  <h1>wrapper_test.sh</h1>
  <pre><code> #! /bin/bash
   
   PIDFILE=/home/jhon/workspace/producer/wrapper_test.pid
   
   case $1 in
     start)
       echo $$ &gt; ${PIDFILE};
       exec /usr/bin/python /home/jhon/workspace/producer/test.py 1&gt;&amp;2 output
       ;;
     stop)
       kill `cat ${PIDFILE}`
       ;;
     *)
       echo &quot;Usage: wrapper {start|stop}&quot; 
       ;;
   
   esac
   exit 0
  </code></pre>
  <p>The result that I want is lets say I do <code>tail -f output</code> and I would see staff coming to the file. I also tried to change <code>1&gt;&amp;2</code> to just <code>&gt;</code> but this creates file, and once I press <code>Ctrl + C</code> than all the data appends to the file.</p>
  <p>But right now, I dont see anything</p>