Expect "spawn" command hangs (269 Views)
Regular Advisor
Posts: 238
Registered: ‎12-30-2007
Message 1 of 2 (269 Views)

Expect "spawn" command hangs


When running the Expect script, it hangs at the spawn command until I issue a control-C.


I have installed expect 5.45, tcltk 8.5.15 on HP-UX 11.31.


Here is the basic script :
#!/usr/local/bin/expect -d
spawn "user@server.com"
expect "password:"
send "password\n"
expect "sftp>"
send "mget *.* \r"
expect "sftp>"
send "quit \r

And here is the debug:
expect version 5.45
argv[0] = /usr/local/bin/expect argv[1] = -d argv[2] = ./sftptest
set argc 0
set argv0 "./sftptest"
set argv ""
executing commands from command file ./sftptest
spawn sftp user@server.com
parent: waiting for sync byte

                   <----- Hangs here forever until I issue Control-C

parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {9247}
sighandler: handling signal(2)
async event handler: Tcl_Eval(exit 130)


I tried to find the solution on forum and found that if we install the earlier version of tcltk 8.5.8 problem will fix. But i was not able to find the depot tcltk8.5.8. And tried downloading the 8.5.8 source code. But I am able to build and install TCL8.5.8 but getting error while building TK 8.5.8

100 errors detected in the compilation of "/tmp/tcltk-8.5.8-src/unix/../generic/tk3d.c".

Compilation terminated.

*** Error exit code 4





Acclaimed Contributor
Posts: 26,027
Registered: ‎03-06-2006
Message 2 of 2 (252 Views)

Re: Expect "spawn" command hangs

>100 errors detected in the compilation of "tk3d.c".


This is useless.  What are the first few errors.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.