Cecil Westerhof wrote: > sqlite3 "${DATABASE}" "begin immediate" 2>/dev/null > errorCode="${?}" > if [[ "${errorCode}" -eq 5 ]] ; then > printf "${DATABASE} is locked\n" > > I saw that when it is locked I get back a 5. Is this always the case?
sqlite3 returns the SQLite error code, and 5 indeed is SQLITE_BUSY. (Non-SQL errors result in 1, which would be the same as SQLITE_ERROR.) Regards, Clemens