最佳答案
We can use the -cmd option with sqlite3 to run a query, but then sqlite3 opens the database and waits in there for interactive input. How can we run a query on sqlite3 from the command line and exit?