title: How to run a sql script file using sqlcmd and output to both shell and file
body: <p>I'm trying to run a sql script from a file using <code>sqlcmd</code>, using the following command:</p>
  
  <pre><code>sqlcmd -S &lt;server&gt; -d &lt;database&gt; -i &lt;input file&gt; -o &lt;output file&gt; 
        -U &lt;user&gt; -P &lt;password&gt;
  </code></pre>
  
  <p>I run my sql file and output to a log file.</p>
  
  <p>The problem is this change the output of <code>sqlcmd</code> to the file.. and i want to get the output also to the shell.</p>