Computing.Net > Forums > Unix > how to track background function

how to track background function

Reply to Message Icon

Original Message
Name: gounix
Date: July 20, 2007 at 05:40:17 Pacific
Subject: how to track background function
OS: SunOS
CPU/Ram: X
Model/Manufacturer: X
Comment:

i have ,say 10 functions , which i run in background by "&"
But "jobs" command doesn't show me its status. "ps" shows commands runnning under it.
Is there any other way so that I can wait for completion of last functions which has ran in backgrond before my code move further

Thanks



Report Offensive Message For Removal


Response Number 1
Name: fpmurphy
Date: July 22, 2007 at 17:18:25 Pacific
Subject: how to track background function
Reply: (edit)

If job control is fully enabled or implemented in your shell, you can use the wait command. See job control in your shell's manpage for more information.


Report Offensive Follow Up For Removal

Response Number 2
Name: gounix
Date: July 23, 2007 at 00:54:38 Pacific
Subject: how to track background function
Reply: (edit)

Thanks fpmurphy.

But how to see PID (which will be input to wait command) of function which I have ran in background?


Report Offensive Follow Up For Removal

Response Number 3
Name: fpmurphy
Date: July 29, 2007 at 17:35:39 Pacific
Subject: how to track background function
Reply: (edit)

Use the pgrep utility is available on your system. Otherwise roll your own using ps and grep.


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: how to track background function

Comments:

 


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