From: expect <ex...@ih...> - 2002-11-25 16:44:18
|
On Mon, 25 Nov 2002 14:32:16 +0100 Roland Giersig <RGi...@cp...> wrote: > > When choosing one script, things break. But choosing the other sh > > script, things work fine. The sh scripts are very similar and > > written using the same sh functions, etc. > > Without the sh scripts its a rather long guess at what might be wrong... Yes, wish I could include them. > > > Now I cut-n-pasted the Expect code, from the perl > > script that is failing to run the sh script, and created a small > > version that does just the Expect part and things work as expected > > (pun). > > > > My guesses were that something wonky was going on with redirecting > > STDOUT and STDERR to log files. > > Is one of the shell scripts putting commands in the background? That > might be a problem... I don't think so but they are running other sh scripts. I don't understand a few things from this output. Why is there more than one hard close? Lines 8 and 26. And what is timing out after ~12 seconds? Line 22 (I measured 12 seconds) . And last why does the string I'm waiting for appear after Expect finally completes and closes everything? This bit of output is what's seen when it fails: -start snippet 1:Spawned '/temp/testinstall.sh' 2: spawn id(9) 3: Pid: 794708 4: Tty: /dev/pts/2 5: Expect::spawn('Expect', '/temp/testinstall.sh') called at ./testinst.pl line 347 6: Use of uninitialized value in concatenation (.) or string at /usr/btools/perl/lib/site_perl/5.6.1/Expect.pm line 1386. 7: Closing . 8: Expect::hard_close('Expect=GLOB(0x20589328)') called at /usr/btools/perl/lib/site_perl/5.6.1/Expect.pm line 1575 9: Expect::DESTROY('Expect=GLOB(0x20589328)') called at ./testinst.pl line 354 10: eval {...} called at ./testinst.pl line 354 11: closed. 12: Closing spawn id(9). 13: Expect::soft_close('Expect=GLOB(0x205ab95c)') called at ./testinst.pl line 411 14: --------------------------------- 15: Installation 16: --------------------------------- 17: 18: Menu 19: 1) Create a new install 20: 2) Drop an install 21: 3) QUIT 22: Timed out waiting for an EOF from spawn id(9). 23: spawn id(9) closed. 24: Pid 794708 of spawn id(9) exited, Status: 0x01 25: Closing spawn id(9). 26: Expect::hard_close('Expect=GLOB(0x205ab95c)') called at /usr/btools/perl/lib/site_perl/5.6.1/Expect.pm line 1575 27: Expect::DESTROY('Expect=GLOB(0x205ab95c)') called at ./testinst.pl line 0 28: eval {...} called at ./testinst.pl line 0 29: Make a choice: [3] --end snippet > > > So I am really puzzled as to why this is failing. > > Please post those shell scripts... Wish I ccould. |