title: time command running on function wont let the function print
body: <p>I have a problem with my code. It doesn't print out an error, it works but it doesn't do what I actually need it to do. I won't be posting all of the code because it is not needed, I will just post the line we need.</p>
  
  <p>So I have this line of code:</p>
  
  <pre class="lang-sh prettyprint-override"><code>TIME1=$( { time awkfun ; } 2&gt;&amp;1 &gt;/dev/null);
  </code></pre>
  
  <p>Where <code>awkfun</code> is a function that should print 500 integers, and <code>TIME1</code> is a variable to store the time that the function will need to run and print. Problem is that normally as I said the function would print around 500 integers in this occasion though that I am using this, it just runs and does the calculations but is not printing. So it actually runs the <code>awkfun</code> function but doesn't let it print, in the time output for this function I also need the time it needs to print everything.</p>
  
  <p>How to do that?</p>
  
  <p>I hope I explained it as good as possible, if any questions arise please don't hesitate to comment, thanks in advance!</p>
  
  <p><strong>P.S</strong></p>
  
  <p>Running in ksh in oracle solaris.</p>