Child exiting and not returning to parent script

I am having a parent scripts which reads a file with child scripts name.
I need to read one by one child script , execute it and

  1. If child script fails send mail to the team with the log file
  2. If the child script executes fine then proceed with the next child script execution.
#! /bin/ksh
set -x
#**************************************************************************#
# Program Name         : test.ksh
#***************************************************************************#

while read line
do
  
  . /child1.ksh 
  returnstatus=$?
  
  if [ returnstatus -ne 0 ]
  then
                <mail the team>
                if [ $? -ne 0 ]
                then
                        echo "Error while sending the mail"
                        exit 255
                else
                        echo "Mail sent successfully"
         fi
  else
                echo "$line ran successfully"
                <run the next child script>
 fi
                                                                                                                                                              
done <"$file"

exit 0
The file will be like
child1
child2
child3
child4
child5

You are not running them, you are sourcing them. I'm assuming this sourced script uses $line, otherwise your program does nothing..

if [ "$returnstatus" -ne 0 ]

I just removed the . from . /child1.ksh
and it worked fine.

The $line is nothing but the following line by line from the file
child1
child2
child3
child4
child5

Good. I wasn't sure if that was intentional, since that's a valid way to run a script in your own shell.