How does shell get the exit status of a child shell while redirecting the output to a file?

scenario: the shell script completes the ETL work. The data extraction, transformation and loading operations correspond to three subscripts, all of which are atomic operations and need to be logged.
idea: call multiple child scripts to control the workflow through a single parent script, and get the exit status and output of the subscript at the same time.
problem: the following script cannot get the exit status of the subscript. You need to have standard output and error output on the screen and log it at the same time.

-sharp!/bin/bash
-sharpparent.sh
echo "You are in parent shell." | tee $0".log"
./child.sh; rc=$? | tee -a $0".log"
echo $rc
-sharp!/bin/bash
-sharpchild.sh
echo "You are in child shell."
exit 1
Aug.31,2021

  https://stackoverflow.com/que.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c2c1-2c2f7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c2c1-2c2f7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?