title: Bash Scripting, send "logout" command being skipped during ssh session
body: <p>Essentially I connect to remote host, authenticate, run command, logout.  However logout command is being skipped.</p>
  
  <pre><code>/usr/bin/expect &lt;&lt; EOD
  spawn ssh $_host
  
  expect "Password: ";
  send "$_pass\r";
  
  expect "$_host&gt;";
  send "sh arp | inc $_host2\r";
  
  expect "$_host&gt;";
  send "logout\r";
  
  EOD
  
  echo "blah blah"
  </code></pre>
  
  <p>What i get is my expected output from arp command however, blah blah will be entered into the terminal of the remote host.  It seems the logout command is being skipped, somewhat new to bash scripting but it seems that expect doesn't instantly see "$_host>" when executing and skips it?  Appreciate any feedback.</p>