我可以在sqlite中链接命令,如:
$ sqlite3 test.sqlite .tables .schema "select * from object_store"
然而,当我尝试使用.print
点命令时,它给出了错误。
$ sqlite3 test.sqlite .print "The Tables Are:" .tables
Error: near "The": syntax error
如何打印字符串时链接命令在sqlite?
找到解决方案。必须将。命令及其参数用"
括起来。
sqlite3 -cmd ".print The Tables Are:n" -cmd ".tables" test.sqlite .quit
或
sqlite3 test.sqlite ".print The Tables Are:n" ".tables"