title: How to kill a process on no output for some period of time
body: <p>I've written a program that is suppose to run for a long time and it outputs the progress to <code>stdout</code>, however, under some circumstances it begins to hang and the easiest thing to do is to restart it.</p>
  
  <p>My question is: Is there a way to do something that would kill the process only if it had no output for a specific number of seconds?</p>
  
  <p>I have started thinking about it, and the only thing that comes to mind is something like this:</p>
  
  <pre><code>./application &gt; output.log &amp;
  tail -f output.log
  </code></pre>
  
  <p>then create script which would look at the date and time of the last modification on <code>output.log</code> and restart the whole thing.</p>
  
  <p>But it looks very tedious, and i would hate to go through all that if there were an existing command for that.</p>