SQLite Forum

.read with parameters... or alternative?
Login
Here is an example of usage where forcing non-interactive operation works differently than letting the shell (try to) figure out there can be no interaction:

```
[C:\Tmp]
> sqlite3 -batch -cmd "select count(*) from sqlite_master;" <nul
0

[C:\Tmp]
> sqlite3 -cmd "select count(*) from sqlite_master;" <nul
0
SQLite version 3.32.3 2020-06-18 14:00:33
Enter ".help" for usage hints.
sqlite>

[C:\Tmp]
>
```

Little gotcha's like this are why I use -batch without attempting to figure out whether it is actually needed. (Sometimes, brain cycles are a scarce resource!)