Bug 52624 - unable to run expect from bash function
unable to run expect from bash function
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: bash (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-08-27 08:10 EDT by Viorel Anghel
Modified: 2007-04-18 12:36 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-08-27 08:10:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Viorel Anghel 2001-08-27 08:10:50 EDT
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 08:19:23 EDT
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.