SQLite Forum

Strange CLI .exit issue
Login
>The sqlite3.exe program is currently working as it ought with respect to the .exit command and reading standard input.

Let me make clear once again, I never asked for the change to be part of the official SQLite3.

Initially, I was curious how come I never encountered it before (same workflow for years) so maybe something had changed in the CLI, and then if my found solution **for my own deviant copy** seems correct given I have no clue about SQLite3 source internals.

So, I simply asked if someone could see a problem with the way I did it.  That's all.

>Can you give an example of any other utility or program that continues reading its input after instructed to exit? I can't find one.

I already mentioned that my editor (PNotepad using just `sqlite3.exe --batch`) hangs.  Again, this could be a problem with that editor.

>What if I have a 1MB script in which ".exit" occurs on the 5th line. You would have SQLite read the entire 1MB just in case the script was piped in? I don't think so.

Sure.  Only if one could know when the stdin is redirected, then it could consume only for that case.  Again, that's only for own use, so pay no more attention to it.

On the other hand, you could think of all content that follows as wrapped inside a false #ifdef ... #endif block.  I believe a compiler would read all the way to find the matching #endif.  So, it's a matter of perspective.