I see many examples showing how to use the sqlite3 interactive shell, for example:
$ sqlite3
$ sqlite3> SELECT * from x;
but I'm looking for a way to create a table in a SQLite3 database using a bash script, aka, non-interactive - does anyone know how to do this?
For example, it does n't seem to work , it remains interactive:
sqlite3 test.db "create table n (id INTEGER PRIMARY KEY,f TEXT,l TEXT);"
sqlite3 test.db "insert into n (f,l) values ('john','smith');"
sqlite3 test.db "select * from n";
Also one question - does it ever help “wake SQLite3” by invoking “sqlite3” as a background process - or does it almost always run in the background on MacOS and Linux?
source
share