I have the following shell script with finds all the files and then should insert the filenames in to the database. The only problem I have is that I keep getting the error:
./testDBScript.sh: line 16: syntax error: unexpected end of file
I am trying to insert in to a mysql database from my script using the following code in a loop like:
for filename in `find . \! -name [*./]`
do
echo "$filename"
insert_statement_for_db="insert into files(filename) VALUES(\"$filename\");"
mysql -h $db_host -u $db_user -D $db_database << finish
$insert_statement_for_db
finish
done
How else could I insert in to the database? As tutorials online lead me to that solution.