![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| wait for 5 seconds in shell script | gopsman | Shell Programming and Scripting | 2 | 08-30-2007 05:47 AM |
| Need to execute 2 scripts, wait, execute 2 more wait, till end of file | halo98 | Shell Programming and Scripting | 1 | 08-01-2006 04:42 PM |
| Difference between writing Unix Shell script and AIX Shell Scripts | haroonec | AIX | 0 | 04-12-2006 02:27 AM |
| How can I wait for PID to finish in another shell | superdelic | UNIX for Advanced & Expert Users | 2 | 01-17-2005 10:17 PM |
| where to put shell scripts? | ober5861 | UNIX for Dummies Questions & Answers | 7 | 07-17-2001 09:04 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
wait in shell scripts
Hi
I am creating 3 background processes in my shell script using &. I have obtained the 3 PIDs of the background processes using $!. I need to wait for these to complete and i need the exit status of each of these. If i use : wait $PID1 wait $PID2 wait $PID3 and get the exit status of each of these waits using $?, then by the time i call wait for, say PID3 , it may have already terminated !! Whereas if i use : wait $PID1 $PID2 $PID3 then i only get the exit status of PID3 If i use wait without specifying any operands then it exits with status 0 after all the processes have terminated even if one of the processes fails. I need to know if any of the procs fails. How do I do this in my shell script......can i use waitpid in my shell script and how? Thanks in advance! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|