Job control | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Job control

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-04-2007
bobk544 bobk544 is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 1 July 2009, 8:34 PM EDT
Location: fairfax virginia
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Job control

Hello,

What is the best way to control the running of scripts?

For example, i have a k1.ksh script java pgm that checks to make sure that the file counts in a particular directory are equal to a total file count value in a control file updated from my PC.

If i run this k1.ksh script and the total counts are equal, what would be the best way to kick off the k2.ksh script to execute a database update?

Should i use a kshell language and say put is something like "if [.......] then...." in the script or is there a better way to determine when to kick off k2.ksh?

Thanks very much for any insights on this!
BobK
Sponsored Links
    #2  
Old 04-05-2007
OFFSIHR OFFSIHR is offline
Registered User
 
Join Date: Oct 2006
Last Activity: 16 May 2007, 10:07 AM EDT
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by bobk544
Hello,

What is the best way to control the running of scripts?

For example, i have a k1.ksh script java pgm that checks to make sure that the file counts in a particular directory are equal to a total file count value in a control file updated from my PC.

If i run this k1.ksh script and the total counts are equal, what would be the best way to kick off the k2.ksh script to execute a database update?

Should i use a kshell language and say put is something like "if [.......] then...." in the script or is there a better way to determine when to kick off k2.ksh?

Thanks very much for any insights on this!
BobK
I'd do it your way and test the return code from the previous script eg

Code:
                       ksh ./k1.sh  
                         
 			if [ $? -ne 0 ] ; then
				TestRunResult=fail
                                return 1
 	      		else
	 			TestRunResult=pass
                                ksh ./k2.sh
 			fi

Sponsored Links
    #3  
Old 04-05-2007
bobk544 bobk544 is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 1 July 2009, 8:34 PM EDT
Location: fairfax virginia
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you for your help on this, have a great week!

BobK
    #4  
Old 04-05-2007
bobk544 bobk544 is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 1 July 2009, 8:34 PM EDT
Location: fairfax virginia
Posts: 58
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks again OFFSIHR for including that "return 1" in the example, now i see how i can call another .ksh and get back a result value, always wondered abou that!!!

good one!
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What is Control M ? mvsramarao UNIX for Advanced & Expert Users 6 11-02-2009 01:35 PM
Whi I'm getting control-M's padpa UNIX for Dummies Questions & Answers 14 12-13-2007 06:18 AM
Fan control Timmy66 BSD 1 08-02-2007 09:59 AM
About Control-M Scheduler uday123 Solaris 0 05-24-2006 11:11 AM
New to Control-M oraclenerd UNIX for Advanced & Expert Users 5 05-18-2006 10:21 AM



All times are GMT -4. The time now is 05:33 PM.