How to return the value from the called shell script to the calling sh script

Hi all,
I have two ksh scripts

#sample1.sh
#!/bin/ksh
. ./sample2.sh
echo $fileExist

#sample2.sh
#!/bin/ksh
func()
{
i=1
return $a
}
func
echo $?

Here how should I return the value of sample2.sh back to sample1.sh?
Thanks in advance.

Regards,
Gaurav

Save $? to another variable instead of echoing it, it will be immediately available. Or use backticks to capture the output of the last echo.

Search in the Forum ..You will get so many clues..

Here is a useful link