One more way to accomplish this can be using SQL_ENTRY_TAG_N
#!/bin/bashsqlite3 mydatabase <<SQL_ENTRY_TAG_1SELECT * FROM sqlite_master;SQL_ENTRY_TAG_1
see snippet for details
#!/bin/bashsqlite3 ex3.db "create table t1(f1 integer primary key,f2 text)"
should work I think, unfortunately, not able to check right now.
You want to feed your SQL DDL commands to SQLite through the standard input:
#!/bin/bashecho 'create table t1(f1 integer primary key,f2 text);' | sqlite ex3.db