title: Teradata - run a file/script at Unix Linux command prompt
body: <p>I have the client/TTU installed on Unix box for Teradata.</p>
  
  <p>If I do the following, it works. Where "..." is Teradata BTEQ normal output and once the following is done, I'm back at the prompt.</p>
  
  <p><strong>$ bteq</strong>
  <br/>...<br/>
  ....<br/></p>
  
  <pre><code>. logon dbname/dbuser,dbpassword
  SELECT DATE, TIME;
  .LOGOFF;
  .QUIT;
  </code></pre>
  
  <p>..<br/>
  ...<br/>
  <strong>$</strong></p>
  
  <p>Now, lets say I put the following lines in a file called "<strong><em>testtd.bteq</em></strong>"</p>
  
  <pre><code>. logon dbname/dbuser,$dbpassword
  SELECT DATE, TIME;
  .LOGOFF;
  .QUIT;
  </code></pre>
  
  <p>What I want now is ... how can I run this script (.bteq) at Unix $ prompt ???</p>
  
  <p>I tried the following methods so far, but they didn't work, may be Im missing anything: <br/>
  1. bteq &lt; /path/to/testtd.bteq > testtd.log<br/><br/>
  2. bteq &lt;
  .run /path/to/testtd.bteq<br/>
  HereDocEndsHere<br/></p>
  
  <p>Any ideas? DO I HAVE to provide ". logon dbname/dbuser,dbpassword" FIRST, if I'm using the HereDocument way?</p>
  
  <p>Running bteq command on $ prompt doesn't even give me any HELP/options that I can use, like other commands.</p>
  
  <p>i.e.
  cmd -u user -p password -f file etc... </p>