![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to capture status code and echo a message | laknar | Shell Programming and Scripting | 12 | 04-30-2008 11:13 AM |
| How to know the status of process running in background | sumanta | Shell Programming and Scripting | 8 | 03-04-2008 05:03 AM |
| how to capture oracle export log while running as background process | hippo2020 | SUN Solaris | 4 | 07-03-2007 03:39 PM |
| exit status of Invoking two or more scripts in background | Omkumar | Shell Programming and Scripting | 4 | 03-31-2005 08:25 AM |
| capture the process id when starting a background process | jleavitt | Shell Programming and Scripting | 10 | 04-04-2002 09:04 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to capture the status of background process
Hi All
I am performing a parallel job by using the background concept. Here is what I am doing. SCRIPTA 1. Take in the argument list store it in an Array 2. Call to SCRIPTB in a while loop till the arguments in the array are present. The call is as follows . ./SCRIPTB [i] & 3. Use the wait command to wait for all the wait till all the background process are completed. 4. ECHO SUCCESS. Now the point is that What I need to do is to perform some operation if all the call to SCRIPTB were succesful. Now for this I am doing the following 1. Take in the argument list store it in an Array 2. Call to SCRIPTB in a while loop till the arguments in the array are present. The call is as follows . ./SCRIPTB [i] & if [ $? -eq 0 ] #ok execution then echo Incrementing the counter for ${brn_array[brnIndex]} successCounter=`expr $successCounter + 1` fi 3. Use the wait command to wait for all the wait till all the background process are completed. 4. Verify the counter and print SUCCESS But the problem is that even if for some arguments . ./SCRIPTB [i] fails then also the return value is 0 and the counter is increasing. Kindly suggest |
| Bookmarks |
| Tags |
| background, background job, exit code, return code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|