title: Export from sqlite to csv using shell script
body: <p>I'm making a shell script to export a sqlite query to a csv file, just like this:</p>
  
  <pre><code> #!/bin/bash
  ./bin/sqlite3 ./sys/xserve_sqlite.db ".headers on"
  ./bin/sqlite3 ./sys/xserve_sqlite.db ".mode csv"
  ./bin/sqlite3 ./sys/xserve_sqlite.db ".output out.csv"
  ./bin/sqlite3 ./sys/xserve_sqlite.db "select * from eS1100_sensor_results;"
  ./bin/sqlite3 ./sys/xserve_sqlite.db ".exit"
  </code></pre>
  
  <p>When executing the script, the output apears on the screen, instead of being saved to "out.csv". It's working doing the same method with the command line, but I don't know why the shell script fails to export data to the file.</p>
  
  <p>What am I doing wrong?</p>