title: Running a interactive command as a background process in shell script
body: <p>I am facing an issue when I am trying to run a interactive command/app in the background of the shell script. I am trying to log the output of the command to a file. But I don't see that command logging anything to the file. Even executing the command in the bash also did not work as it gets suspended.</p>
  
  <p>Sample script</p>
  
  <pre><code>#!/bin/bash
  while true
  do
  ./a.out &gt; test &amp;
  PID=$!
  sleep 20
  kill -9 $PID
  done
  </code></pre>
  
  <pre><code>[@myprog]$ ./a.out &amp;
  [1] 3275
  Program started
  
  [1]+  Stopped                 ./a.out
  [@myprog]$ 
  </code></pre>