title: Unexpected end of file error shell script
body: <p>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: </p>
  
  <pre><code>./testDBScript.sh: line 16: syntax error: unexpected end of file
  </code></pre>
  
  <p>I am trying to insert in to a mysql database from my script using the following code in a loop like: </p>
  
  <pre><code>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 &lt;&lt; finish
      $insert_statement_for_db
      finish
  done
  </code></pre>
  
  <p>How else could I insert in to the database? As tutorials online lead me to that solution. </p>