The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
Notification from Background jobs vibhor_agarwali UNIX for Advanced & Expert Users 19 06-20-2007 05:29 AM
limit the number of jobs to run. GrepMe Shell Programming and Scripting 0 06-15-2007 01:39 PM
Issues with exit after running jobs in background hyennah Shell Programming and Scripting 1 04-03-2007 01:44 AM
Background jobs Jeremiorama High Level Programming 1 11-25-2005 09:48 AM
background jobs qsi Shell Programming and Scripting 4 11-24-2004 05:45 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-11-2007
GrepMe GrepMe is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 11
Background jobs exit status

i need to execute 5 jobs at a time in background and need to get the exit status of all the jobs i wrote small script below , i'm not sure this is right way to do it.any ideas please help.


$cat run_job.ksh

#!/usr/bin/ksh
####################################
typeset -u SCHEMA_NAME=$1
count=0
cat $home/tablist.list|
while read table
do
sas $table.sas &
count=`expr $count + 1`
echo $count
RC=$?
if (( $RC > 0 )); then
echo " executing the n't succes for $table :$RC "
exit 1
fi
cnt=$(jobs -l | wc -l )
if [[ $cnt -le 5 ]] ; then
continue
else
wait
#echo "In the wait mode"
fi
done
exit 0

Last edited by GrepMe; 06-15-2007 at 01:27 PM.. Reason: can anybody help me.
  #2 (permalink)  
Old 06-11-2007
GrepMe GrepMe is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 11
Can somebody help me with this code

PHP Code:
background jobs exit status and limit the number of jobs to run 

Last edited by GrepMe; 06-12-2007 at 02:20 PM..
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0