I have a directory with lots and lots of SQLite database files.
I need to run an sqlite3 query to establish if any database in my directory contains a specific table. Database filenames go like 001.db, 002.db, etc. If a database contains the table I require, the file is copied to a different directory.
My initial thoughts are similar to this:
while [ sqlite3 $* "SELECT * FROM table1" != "Error: no such table: table1" ]`
do
cp $* newdir/
done
or something similar, and I need some help with correct syntaxis please...
in "$*" I meant a database file currently being processed inside the directory, not sure if it is correct...