title: Run a loop in bash with timeout in a single line
body: <p>I need to have a single line command that does something in a loop with a timeout.</p>
  
  <p>Something like</p>
  
  <pre><code>export TIMEOUT=60
  export BLOCK_SIZE=65536
  COMMAND="timeout TIMEOUT while true; do dd if=/tmp/nfsometer_trace/mnt/TESTFILE of=/dev/null bs=BLOCK_SIZE; done"
  </code></pre>
  
  <p>The command will be executed in 'sh' by doing the following:</p>
  
  <pre><code>echo $COMMAND &gt; COMMAND_FILE
  sh COMMAND_FILE
  </code></pre>
  
  <p>But this gives me a syntax error:</p>
  
  <blockquote>
    <p>syntax error near unexpected token `do'</p>
  </blockquote>
  
  <p>Is there any way to have a single line command to timeout an infinite loop?</p>