. ${script_name} | tee -a ${log_file}
KornShell unfortunately does not have a PIPESTATUS command like Bash does and I would like to know if anybody has an elegant solution to getting the exit status of the first command (above). This is what I've pieced together from code found around the internets.
{
typeset -r script_rc=$(
{
{
. ${script_name}
echo "$?" >&3
} | tee -a ${log_file}
} 3>&1 >&4 4>&-
)
} 4>&1
Unfortunately this code is hard to read and I was wondering if someone knew of something more readable.