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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Whi I'm getting control-M's padpa UNIX for Dummies Questions & Answers 14 12-13-2007 07:18 AM
Fan control Timmy66 BSD 1 08-02-2007 10:59 AM
New to Control-M oraclenerd UNIX for Advanced & Expert Users 5 05-18-2006 11:21 AM
Removing control-Ms (^M) djkane Shell Programming and Scripting 6 03-06-2006 10:48 AM
Control the telnet ust Shell Programming and Scripting 0 02-09-2006 11:52 AM

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

Join Date: Jan 2006
Location: fairfax virginia
Posts: 58
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
  #2 (permalink)  
Old 04-05-2007
OFFSIHR OFFSIHR is offline
Registered User
  
 

Join Date: Oct 2006
Posts: 23
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

  #3 (permalink)  
Old 04-05-2007
bobk544 bobk544 is offline
Registered User
  
 

Join Date: Jan 2006
Location: fairfax virginia
Posts: 58
Thank you for your help on this, have a great week!

BobK
  #4 (permalink)  
Old 04-05-2007
bobk544 bobk544 is offline
Registered User
  
 

Join Date: Jan 2006
Location: fairfax virginia
Posts: 58
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!
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 06:24 PM.


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