title: Can the expect script continue to execute other command after "interact"?
body: <p>I am writing a script to run ssh so as to login a remote host, after all the operation is done, I type exit and log off. But I want the script to continue running and write log on the local host. The script is something like:</p>
  <pre><code>#!/usr/bin/expect
  spwan ssh qwerty@remote_host
  
  expect {
      &quot;password:&quot; {
          send &quot;123123\r&quot;
      }
  }
  
  interact;
  send &quot;echo $(date) &gt;&gt; login_history.log\r&quot;
  </code></pre>
  <p>But the last command &quot;send ...&quot; always failed with the error message like
  &quot;send: spawn id exp4 not open ...&quot;</p>
  <p>When I log off from the remote host, can the expect script continue to work as it is running on the local host?</p>