Can I monitor the progress of importing a large .sql file in sqlite3 using zenity --progress? I'm trying to monitor the progress of a sqlite3 command importing a large .sql file into a database using zenity --progress.  

I've tried the following which will import the file, however progress is not shown:  

sqlite3 DATABASE &lt; import_file.sql | zenity --progress --percentage=0 --auto-close


I know I need to provide zenity a numeric source for the progress, but don't really know how to obtain the number.  

Can anyone help me?
The sqlite3 tool does not output such numbers.

You would have to write some script that feeds the lines of the import file into sqlite3, and at the same time feeds the percentage numbers into zenity. Try something like this:

#!/bin/bash
maxlines=$(wc -l &lt; import_file.sql)
exec 3&gt; &gt;(zenity --progress --auto-close)
counter=0
while IFS= read -r line; do
    echo "$line"
    counter=$(($counter+1))
    echo $(($counter * 100 / $maxlines)) &gt;&amp;3
done &lt; import_file.sql


Call it with thescript | sqlite3 dbfile.