2014-03-06 37 views
0

我有以下Perl腳本代碼來安裝oracle數據庫應用程序。如何讓我的腳本等到上一個命令完成?

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

在這段代碼中,應該在完成安裝應用程序後執行if塊。但腳本與安裝程序並行運行。

我都用了``EXEC,而不是制度,而是根據需要沒有工作。

幫我解決這個問題。

在此先感謝。

+0

也許安裝程序切換到後臺的詳細信息? –

+0

也許runInstaller立即返回? – anonymous

+0

不,runInstaller正在研究前景。 – user3274006

回答

2

使用runInstaller的-waitforcompletion選項使腳本等待,直到完成執行。所以現在:

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

將成爲

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

有關runInstaller的Click here

相關問題