call a script from script

Hi all,

I want to call a unix script from another unix script.

I tried .sh command but not able to run.

Any idea.

Regards,
gander_ss

if u want to run a1.ksh script from b1.ksh script then do as follows

in the b1.ksh script

sh a1.ksh

and save the file and run the b1.ksh

hi gander_ss

can u please post your script.....

If u are in the a1.ksh script and want to run the a2.ksh from it, just do this
. a2.ksh
If you are in a different folder :
. /your/folder/a2.ksh

What does the script you want to call do?

First of all, all scripts need to have the chmod +x performed to make them executable.
Beyond that, your main program will be something like:

#!/bin/bash
scrloc="/usr/bin/scripts/"

{rest of program}

if [ "$switch" = "a" ]
then
"$scrloc"scripta.sh
fi
if [ "$switch" = "j" ]
then
"$scrloc"scriptj.sh
fi
exit

This sets the location for where to find scripts - useful when you want to make the program more flexible by sharing/saving scripts in common location - as $scrloc. Then checks to see if a condition is met, and calls appropriate script {examples are named scripta & scriptb}.