The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Number of long limit herath UNIX for Dummies Questions & Answers 2 06-02-2008 11:31 PM
Limit of number of lines for awk and sed. 60doses Shell Programming and Scripting 2 01-17-2008 01:52 AM
background jobs exit status and limit the number of jobs to run GrepMe Shell Programming and Scripting 1 06-11-2007 03:56 PM
How to limit the number of running instances of a script? oti Shell Programming and Scripting 2 06-25-2004 12:31 PM
limit to number of files in a given directory hedrict UNIX for Advanced & Expert Users 2 02-05-2004 12:14 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-15-2007
Registered User
 

Join Date: Jun 2007
Posts: 11
limit the number of jobs to run.

i just want to get the BackGround status and limit the number of jobs to run the at a time.

can i able get the back ground exit status ? that i code below.

can jobs -l limit the number of jobs to run ?

total is this script looks fine ?


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
Reply With Quote
Google UNIX.COM
Forum Sponsor
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:38 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0