There is a bash script that will do "some magic"™ to files which will be referenced to a sqlite database and after doing "some magic"™ the database should be updated. Here are the simplified code
sqlite3 database.db "select NUMBER from table WHERE STATUS = 'N'" | while read line; do
SELECTION=$(echo $line | awk -F'|' '{ print $1 }')
[some magic]™
sqlite3 database.db "update table SET STATUS='Y' WHERE NUMBER='$SELECTION'"
done
Everything works, the sqlite database will be read line by line and I could do "some magic"™ to the referenced files, but I can´t update the line in the database - I´ve got an error:
Error: database is locked
Anybody knows how I could update a database while reading a database? Or are there another solution how I could do this?