Andreas, The issue here has less to do with dot commands, and more with the database initialization behavior.
When you call # /usr/local/bin/sqlite3 ./monitor.dbx .dump > monitor.dump it's going to build the monitor.dbx database file first, then do the dump on the (empty) database. This is standard SQLite behavior, and there are no CLI switches to get around it. In order to get the behavior you are looking for, you should try to ATTACH monitor.dbx after starting sqlite3, and not supply a name on the command line. -Jon ______________________________________ Jon Polfer Project Engineer - High Level Software Engineering Office Phone: 262-832-0049 (Ext. 5 for Jon Polfer) Fax: E-mail: [email protected] FORCE America Inc. W229 N1433 Westwood Drive, Suite 200 Waukesha, WI 53186 www.forceamerica.com The Leading Innovator in Mobile Hydraulic Solutions -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Andreas von Euw Sent: Thursday, November 04, 2010 8:18 AM To: [email protected] Subject: [sqlite] Bugreport: sqlite dot commands should return a vaild returncode Hi all, The dot commands of sqlite CLI (.dump, .import, ...) should implement a correct exception handling. For example: If a database file doesn't exist or the database is locked by another sqlite process, then sqlite returns exit code 0 and no error message. I would expect a non-zero exit code. But it seems that they return always 0. Tested with sqlite 3.7.2 and 3.6.13 on Solaris 10: # ls -l ./monitor.dbx ./monitor.dbx: No such file or directory # /usr/local/bin/sqlite3 ./monitor.dbx .dump > monitor.dump # echo $? 0 and an empty database file is created, that should not be: # ls -l ./monitor.dbx -rw-r--r-- 1 root root 0 Nov 4 13:08 ./monitor.dbx Functions that return always 0 are difficult to to integrate in shell scripts ... Regards, Andy von Euw -- -- ========================================================== -- -- JomaSoft GmbH -- Andreas von Euw -- Brauerstrasse 79a, CH-9016 St. Gallen, Switzerland -- [email protected] http://www.jomasoft.ch -- ========================================================== -- _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users The information contained in this message and any attachment may be proprietary, confidential, and privileged or subject to the work product doctrine and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it and all copies and backups thereof. Thank you. Disclaimer added by CodeTwo Exchange Rules http://www.codetwo.com _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

