Description of Problem: expect hangs when called from a bash function (but run normally from a script). then, it can killed only with kill -9. Version-Release number of selected component (if applicable): I'm not very sure if this is expect or bash related. I get the same behavior with bash-1.14.7-23.6x bash2-2.03-8 expect-5.28-35 on redhat linux 6.2 How Reproducible: #!/bin/bash #function aa () { cat <<EE | expect -f - spawn telnet localhost 25 expect "Connected to" { sleep 1 send -- "quit\r" expect eof exit } EE #} #aa Steps to Reproduce: 1. run the above script (should be ok) 2. uncomment function definition and call from script and run again 3. should hang at spawn telnet localhost 25 Actual Results: it hangs. can be killed only with -9 Expected Results: spawn telnet localhost 25 Trying 127.0.0.1... Connected to localhost.localdomain. Escape character is '^]'. quit 220 pie ESMTP Sendmail 221 pie closing connection Connection closed by foreign host. Additional Information:
Works here with bash-2.05-8 and expect-5.32.2-64