Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using wait in ksh 1

Status
Not open for further replies.

cdlvj

MIS
Nov 18, 2003
677
US
The docs are not clear on how to do the following:

script runs 10 programs in background. This is testing a driver for multiple opens.
Code:
prgm1 &
prgm1 &
prgm1 &
prgm1 &
prgm1 &
prgm1 &
prgm1 &
prgm1 &
prgm1 &
prgm1 &
wait

I want to wait until the 5th instance is complete. The above will wait until all 10 are complete. A "wait %-" will wait till #9 is done. There is the %number identifer but how do you capture it at the 5th, and do the wait.
I have tried the trap with the -m option, I thought that the trap would be executed 10 times, but I just get it once.
Thanks
 
In yourShell man page have a look to the $! variable.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks a bunch, I knew it had to be something simple.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top