title: Linux terminal output redirection
body: <p>I want to redirect the output of a bash script to a file.</p>
  
  <p>The script is:</p>
  
  <pre><code>#!/bin/bash
  echo "recursive c"
  for ((i=0;i&lt;=20;i+=1)); do
  time ./recursive
  done
  </code></pre>
  
  <p>But if I run it like this:</p>
  
  <pre><code>script.sh &gt;&gt; temp.txt
  </code></pre>
  
  <p>only the output of ./recursive will be captured in the file.</p>
  
  <p>I want to capture the output of time command in the file.</p>