title: Display the output on the terminal and tail the last 10 lines to log file
body: <p>I need to run a script and output the full contents to the terminal.
  I then want to get the last 10 lines from the terminal output and put them in a log file.
  I have tried using <code>./script.sh 2&gt;&amp;1 | tail -10 &gt; log.log</code>
  but this stops the output to the terminal.</p>