0

I have the following Perl script code to install oracle DB application.

system("./runInstaller -silent -responsefile filename.rsp");
if($?==0)
{
   //perform some operation type1;
}
else
{
   //perform some operation type2;
}

In this code the execution of if block should be performed after the complete installation of the application. But the script runs parallel to the installer.

I have used both `` and exec instead of system, but none works as needed.

Help me in solving this.

Thanks in advance.

4
  • Perhaps installer goes to background? Commented Mar 6, 2014 at 11:48
  • Maybe runInstaller is returning immediately? Commented Mar 6, 2014 at 11:48
  • Nope, the runInstaller is working on the foreground. Commented Mar 6, 2014 at 12:00
  • 1
    system waits for the process it creatures to exit before returning. That means runInstaller is returning before you think it does. Commented Mar 6, 2014 at 13:39

1 Answer 1

2

Using of -waitforcompletion option of runInstaller makes the script to wait till it complete execution. So now:

system("./runInstaller -silent -responseFile filename.rsp");

will become

system./runInstaller -silent -waitforcompletion -responseFile filename.rsp");

For more info on runInstaller Click here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.