is there an alternative to \"tee\" which captures STDOUT/STDERR of the command being executed and exits with the same exit status as the processed command. Something as followin
Stumbled upon a couple of interesting solutions here http://www.perlmonks.org/?node_id=597613.
1) There is $PIPESTATUS variable available in bash:
false | tee /dev/null
[ $PIPESTATUS -eq 0 ] || exit $PIPESTATUS
2) And the simplest prototype of "eet" in perl may look as follows:
open MAKE, "command 2>&1 |" or die;
open (LOGFILE, ">>some.log") or die;
while () { print LOGFILE $_; print }
close MAKE; # to get $?
my $exit = $? >> 8;
close LOGFILE;