Depending on how you are calling sqlite3, you should be able to feed any list of commands into it.
For example, under a typical Unix shell you could do sqlite3 mydb <<EOF .mode csv .show EOF Here, in fact, is what happens when I type just that /var/www/canal$ sqlite3 mydb <<EOF > .mode csv > .show > EOF echo: off explain: off headers: off mode: csv nullvalue: "" output: stdout separator: "," width: /var/www/canal$ But this is really about scripting on whatever system you're using, not SQLite as such. Wensui Liu wrote: > wonderful question, it is also what i'd like to know. > > On Thu, Dec 31, 2009 at 1:03 PM, Simon Slavin <slav...@bigfraud.org> wrote: >> On 31 Dec 2009, at 4:56pm, Kees Nuyt wrote: >> >>> On Thu, 31 Dec 2009 04:24:51 +0000, Simon Slavin >>> <slav...@bigfraud.org> wrote: >>> >>>> On 31 Dec 2009, at 2:13am, Wensui Liu wrote: >>>> >>>>> i am trying to change the output by 'sqlite3 mydb ".mode csv"'. >>>>> however, when i type 'sqlite3 mydb .show', I couldn't see the change >>>>> of mode at all. >>>> Each new 'sqlite3' command starts a new instance of the application, and >>>> the new instance starts with all settings set to the defaults. >>> Correct. >>> >>> Additionally, if Wensui Liu wants to have his own defaults, >>> he can put a .sqliterc file in his home directory >> How would I string two commands together in the command-line ? Is there a >> way to do something like >> >> sqlite3 mydb ".mode csv<return>.show" >> >> ? >> >> Simon. >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> > > > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users