#!/bin/bash closeDatabase() { echo 'vacuum;' >&3 echo .quit >&3 (( debug )) && echo -n "Waiting for SQLite to terminate... " wait (( debug )) && echo OK exec 3>&- exec 4<&- rm "$tempdir"/sqlite.{in,out} }