perl expect->spawn cannot find the executable file.

S

Swamy

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top