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

I'd do it your way and test the return code from the previous script eg

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


Thank you for your help on this, have a great week!

BobK

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! :wink: