in reply to Re: How to recieve the exit code of a script executed through Expect ?
in thread How to recieve the exit code of a script executed through Expect ?

Hi, the wrapper script didnt help. If I run my script with $exp->exp_internal(1); I see the following output:
Sending 'exec wrapper.sh\n' to spawn id(3) at /export/home/ana37/utils/linux/perl/site/lib/Expect.pm line 1264 Expect::print('Expect=GLOB(0x1f515338)', 'exec wrapper.sh\x{a}') c +alled at test.pl line 32 In dummy.pl~!!!!!!!!!!!!!!!! ** Installation finished successfully 0 Starting EXPECT pattern matching... at /export/home/ana37/utils/linux/perl/site/lib/Expect.pm line 561 Expect::expect('Expect=GLOB(0x1f515338)', 5, 'ARRAY(0x1f121428)', +'ARRAY(0x1f536fc0)') called at test.pl line 46 spawn id(3): list of patterns: #1: -re `(?-xism:1)' #2: -re `(?-xism:0)' spawn id(3): Does `' match: pattern #1: -re `(?-xism:1)'? No. pattern #2: -re `(?-xism:0)'? No. -1
so there is no match ...
  • Comment on Re^2: How to recieve the exit code of a script executed through Expect ?
  • Download Code

Replies are listed 'Best First'.
Re^3: How to recieve the exit code of a script executed through Expect ?
by Illuminatus (Curate) on May 06, 2010 at 13:31 UTC
    There is no match because your perl program prints output. My example only expected the return status as output. Make sure that your script either only prints the exit status value, or that your expect call handles other possible outputs too.