title: expect script stop after sending \003
body: <p>Need some assistance on an expect script where it would not continue. The function of the script is to connect on remote hosts, change user then ran a command. But i place a else statement that when the change user prompts to update password it will just skip that and continue on the next host. However the script stops on the point where i send \003.The expect script is indicated below;</p>
  
  <pre><code>#!/usr/bin/expect -f
  set i [open "eposhosts"]
  set hosts [split [read -nonewline $i] "\n"]
  
  foreach host $hosts {
  spawn /usr/bin/ssh -q appadm@$host
  expect "appadm@$host:~&gt;"
  send "su epos\r"
  expect "Password:"
  send "password\r"
  expect {
  "epos@$host:/home/appadm&gt;" {send "grep playlist /appl/epos/bin/cron.epos\r"; exp_continue}
  "(current) UNIX password:" {send "\003"; exp_continue}
  }
  expect {
  "epos@$host:/home/appadm&gt;" {send "exit\r"; exp_continue}
  "[appadm@$host ~]" {send "exit\r"}
  }
  expect "appadm@$host:~&gt;"
  send "exit\r"
  expect eof
  }
  </code></pre>