Bug 52624 - unable to run expect from bash function
Summary: unable to run expect from bash function
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bash
Version: 6.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-27 12:10 UTC by Viorel Anghel
Modified: 2007-04-18 16:36 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-08-27 12:10:54 UTC
Embargoed:


Attachments (Terms of Use)

Description Viorel Anghel 2001-08-27 12:10:50 UTC
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:

Comment 1 Bernhard Rosenkraenzer 2001-08-27 12:19:23 UTC
Works here with bash-2.05-8 and expect-5.32.2-64



Note You need to log in before you can comment on or make changes to this bug.