jeudi 10 mars 2016

How to tell SQLITE to ignore STDIN?

I am executing sqlite as:

sqlite3 -batch -cmd "select col2 from mytable where col1 = 'myvalue';" mydb

I want it to execute the select statement and exit, but instead it sits there and waits for further input, wanting an .exit command.

I do not have the option of doing </dev/null as I am executing the command programmatically and not from a shell script.

How can sqlite3 exit in a one-line command without using shell redirection or pipes?

Aucun commentaire:

Enregistrer un commentaire