I can chain commands in sqlite like:
$ sqlite3 test.sqlite .tables .schema "select * from object_store"
However, when I try to use .print
dot-command, it gives error.
$ sqlite3 test.sqlite .print "The Tables Are:" .tables
Error: near "The": syntax error
How to print string when chaining commands in sqlite?
CodePudding user response:
Found the solution. Have to wrap the dot-command and its arguments with "
.
sqlite3 -cmd ".print The Tables Are:\n" -cmd ".tables" test.sqlite .quit
or,
sqlite3 test.sqlite ".print The Tables Are:\n" ".tables"