title: Sybase query:save an output to a file
body: <p>I´ve created the following script:</p>
  
  <pre><code>    #!/bin/bash
  
      isql -U databasename_dba -P password -b &lt;&lt;EOF!
      select quantity, date from name_table where numer_id="1234" 
      go
      quit
      EOF!
  </code></pre>
  
  <p>Running the script I got the desirable output, see:</p>
  
  <pre><code>user@system$ ./EXECUTE_DAILY_4:
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ks4xD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ks4xD.png" alt="enter image description here"></a></p>
  
  <p>But now, how can I save this result that I see in my terminal window in a file? (.csv for example)</p>
  
  <p>I adapted  the  <a href="https://unix.stackexchange.com/questions/299978/shell-script-redirect-sql-query-output-to-a-file">following</a> to my Sybase query:</p>
  
  <pre><code>#!/bin/bash
  cat &gt; test.sql &lt;&lt;EOF!
  
  isql -U databasename_dba -P password -b
  select quantity, date from name_table where numer_id="1234"
  go
  quit
  EOF!
  isql test.sql &gt;result.csv
  </code></pre>
  
  <p>Without success, the above is not working.</p>
  
  <p>Thanks in advance</p>