![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| background jobs exit status and limit the number of jobs to run | GrepMe | Shell Programming and Scripting | 1 | 06-11-2007 07:56 PM |
| background job finished notification | nkeller | UNIX for Dummies Questions & Answers | 4 | 03-08-2007 12:41 PM |
| Background jobs | Jeremiorama | High Level Programming | 1 | 11-25-2005 09:48 AM |
| Checking background jobs from another session | vikingshelmut | UNIX for Dummies Questions & Answers | 3 | 10-12-2005 06:34 PM |
| background jobs | qsi | Shell Programming and Scripting | 4 | 11-24-2004 05:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Notification from Background jobs
Reposting, as it got lost during the database backup.
![]() Via a shell script a spawn 3 background jobs namely a, b & c. These will take different times to complete. I want to print a different message on completion of each. How can i find out when each one has completed independently. Thanks |
|
||||
|
Hi, Does this approach helps?. Gurus, Please provide suggestions. Code:
#!/bin/ksh
LOG_FILE=/tmp/${0##*/}.log
LogMsg() {
print "$(date +%d/%m/%y:%H:%M:%S) : $@" >> $LOG_FILE
}
CallA() {
LogMsg "Calling Function A"
iostat 5 5 >> $LOG_FILE &
wait $!
LogMsg "A done with $!"
return 45
}
CallB() {
LogMsg "Calling Function B"
vmstat 5 5 >> $LOG_FILE &
wait $!
LogMsg "B done with $!"
return 46
}
Main() {
LogMsg "Starting the Process - Main"
CallA
Ret=$?
LogMsg " Returned value $Ret "
CallB
Ret=$?
LogMsg " Returned value $Ret "
}
# Call the Main Function here
Main
Thanks Nagarajan Ganesan |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|