title: How to set timeout on exec command?
body: <p>I have a sample.sh script:</p>
  
  <pre><code>#!/bin/sh
  
  echo "start";
  exec java -jar myjar.jar
  echo "finished successfully";
  </code></pre>
  
  <p>how can I add timeout to
  <code>exec java -jar myjar.jar</code> command?
  After 10 seconds java program should be terminated and there should be printed:
  "FAIL: Timed out after java -jar myjar.jar" on the std output.</p>