Computing.Net > Forums > Unix > Waiting problem - KSH script

Waiting problem - KSH script

Reply to Message Icon

Original Message
Name: lankrypt0
Date: June 1, 2007 at 07:45:40 Pacific
Subject: Waiting problem - KSH script
OS: KSH
CPU/Ram: N/a
Model/Manufacturer: N/a
Comment:

I am writing a KSH script with an SQL query in the middle, and then finished with some clean up processes. The problem I am running into is that sometimes the SQL server becomes a bit lagged so the whole query doesnt finish. As an example, I have the script below.

#!/usr/bin/ksh
print a
sqlplus TNAME/example@ABCD @test.sql
print b

What I would like to happen is have the script print a, then complete the whole sqlplus query, THEN print b. The problem I have now is that it will print a, start the query, then immediately print b. I have tried the wait command with a 5 minute (300 seconds) wait, but that doesnt always work.

Any help would be greatly appreciated.



Report Offensive Message For Removal


Response Number 1
Name: fpmurphy
Date: June 3, 2007 at 10:25:34 Pacific
Subject: Waiting problem - KSH script
Reply: (edit)

One way is to use a named pipe.

Rather than write an example of a named pipe script, I googled the Internet and came across the
following example:

http://www.ixora.com.au/q+a/0111/08...



Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Waiting problem - KSH script

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software