The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
URL call from SHELL script chengwei Shell Programming and Scripting 33 1 Week Ago 06:21 AM
how to execute a batch script from shell script lakshmis10 Shell Programming and Scripting 1 10-17-2007 09:43 AM
how can a call shell script from pl/sql rajesh.P UNIX for Dummies Questions & Answers 0 09-13-2007 11:42 PM
How to call a perl script from a shell script anumkoshy Shell Programming and Scripting 2 08-30-2007 01:23 AM
Have a shell script call another shell script and exit heprox Shell Programming and Scripting 2 11-20-2006 04:17 AM

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

Join Date: Oct 2007
Posts: 13
Red face To call/execute a shell script from a shell script

Hi ,

I have 4 shell scripts
a.ksh
b.ksh -> depends on a.ksh success -> log into b.log
c.ksh -> depends on b.ksh success -> log into c.log
d.ksh -> depends on c.ksh success -> log into d.log


I will have to write main.ksh
(
execute a.ksh , log into a.log
if a.ksh= success, execute b.ksh , log into b.log ,else exit
if b.ksh= success, execute c.ksh , log into c.log ,else exit
if c.ksh= success, execute d.ksh , log into d.log ,else exit
)
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-26-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
No magic here

Code:
#!/bin/ksh
a.ksh
if test "$?" != "0"; then exit 1; fi
b.ksh >b.log
if test "$?" != "0"; then exit 1; fi
c.ksh >c.log
if test "$?" != "0"; then exit 1; fi
d.ksh >d.log
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:20 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