how to call one script frm another

Hi all,

I would like to know how to call one script from another and the return the value of the called script to the calling script for further processing?(in bash)

This is kinda urgent ,pls assist

Regards
wrapster

. /path/to/your/script.sh

To call a script, simply issue the command as you would type it at the normal prompt.

#script one
echo "hello"
#call second script
good_day
#say good-bye
echo "good-bye"
exit

#script good_day
echo "good day to you"
exit 0

The above are simplified, but hopefully show you the simple logic. The last line of 'exit 0' ends the program and returns an error code of 0.
Before my '#say good-bye' line, I could check for a returned value, with somthing like:

if [ "$?" -ne 0 ]
   then
      echo "A value was returned"
fi

So, you can pass something back as part of the error-handling ability of master programs and called programs.

Otherwise, the only other effective way I know of to pass data from a called program back to the master program is to write the information to a temporary file.

Hi,
I need to rin few other scripts from one main (mather) script. Working in ksh on LINUX. The only one condition - it should be run in parallel.
I mean I have to be able to call 20 scripts from this mather script in parallel (start them in the same time). Does somebody know how to do it?

Thanks,
Juliy

call each script one by one and run them in background
scr1 &
scr2 &
scr3 &
.
.
.
scr20 &