On Thu 13 Apr 2023 at 15:33:21 +0100, Mike Pumford wrote: > This construct is necessary as if you do: > make install 2>&1 | tee -a logfile > status=$? > > Then status is the status of the 'tee' command not the make command. Yes I > know about set -o pipefail but there are some places I use the script where > that's not a supported option. Would script -c "make install" logfile status=$? work for you? That would use a pty to capture the output, and it looks like script tries to replicate the command's exit status. > Mike -Olaf. -- ___ "Buying carbon credits is a bit like a serial killer paying someone else to \X/ have kids to make his activity cost neutral." -The BOFH falu.nl@rhialto
Attachment:
signature.asc
Description: PGP signature