perl expect->spawn cannot find the executable file.

Discussion in 'Perl Misc' started by Swamy, May 28, 2004.

  1. Swamy

    Swamy Guest

    I have written a perl/expect program to automate the interactive shell
    program.
    The shell program needs to be run in local directory. That's fine. I
    have done the following..

    $exp->expect(30,"-re", $prompt);
    $exp->send("cd <dir path>");
    $exp->expect(30,"-re", $prompt);
    $exp->send("pwd\n");
    $exp->expect(30,"-re", $prompt);
    $exp->spawn("install.sh");
    ^^^^^^^^
    or $exp->spawn("./install.sh);

    If I do this, I get an error saying install.sh is not found and
    further expect command complains unidentified variable error or
    something..

    If I do

    $exp->spawn("<dir path>/install.sh"); it works, but
    installation fails.

    The installation script looks for certain files locally and I have to
    run this script from its. current directory. Can anybody tell me how
    to make spawn work?

    thanks
    Swamy
     
    Swamy, May 28, 2004
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Derek Basch
    Replies:
    2
    Views:
    1,372
    Donn Cave
    Jan 21, 2005
  2. Simon Strandgaard

    how to expect eof with expect+pty

    Simon Strandgaard, Dec 20, 2006, in forum: Ruby
    Replies:
    4
    Views:
    437
    Simon Strandgaard
    Dec 20, 2006
  3. Ed Hames
    Replies:
    0
    Views:
    439
    Ed Hames
    Apr 16, 2008
  4. Edgardo Hames
    Replies:
    1
    Views:
    430
    Ed Hames
    May 6, 2008
  5. Replies:
    0
    Views:
    107
Loading...

Share This Page