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.
echo "You are in parent shell." | tee $0 ".log"
. / child.sh; rc=$? | tee-a $0 ".log"
echo $rc
echo "You are in child shell."
exit 1-sharp-sharp-sharp problem description
the platform version of the problem and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)