![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Identifying and grouping OS processes and APP processes | wilsonee | SUN Solaris | 2 | 09-30-2008 09:26 AM |
| Monitoring Processes - Killing hung processes | ukndoit | UNIX for Advanced & Expert Users | 4 | 01-17-2008 04:30 AM |
| Processes | Beetlejuice | UNIX for Dummies Questions & Answers | 4 | 04-06-2005 12:33 PM |
| processes | master_6ez | Shell Programming and Scripting | 3 | 11-24-2004 09:48 AM |
| processes | mma_buc_98 | UNIX for Dummies Questions & Answers | 1 | 08-13-2002 05:25 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
|||||
|
It is possible, but I would not use co-processes. I would just use background jobs.
The main script can remember the pid's of the background jobs that it launches. By doing "kill -0 $pid 2> /dev/null" and then checking the $? variable, it can monitor them to see if they are still running. The kill will do nothing except succeed if the process is still running. And it will fail if the process has exited. Since kill is a ksh built-in, this is not an expensive test. It would be very hard for the background jobs to asyncronously notify the main script as they finish. If you really want to do that, you will need signal handlers. It is much better if the main script just polls the background jobs. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|