title: send: spawn id exp7 not open
body: <p>When I try to execute autoexpect file I get an error <code>send: spawn id exp7 not open</code>
  Here is my file <code>sh.exp</code>:</p>
  
  <pre><code>#!/usr/bin/expect
  
  # mysql credentials and connection data
  db_host='localhost'
  db_name='webui_dev'
  db_user='root'
  db_pass=''
  new_db_name='db_2011'
  
  expect &lt;&lt;EOF
    log_user 0
    spawn mysql -h $db_host -u $db_user -p $db_pass 'create database $new_db_name'
    expect "password:"
    send "$db_pass\r"
    log_user 1
    expect eof
  EOF
  </code></pre>
  
  <p>Can't find where is an error.</p>