Possible Duplicate:
unix shell, getting exit code with piped child
is it possible to have the result of a command (what's usually in $? variable) which is at the beginning of a pipeline ?
eg :
rm -rf filename_to_delete | tee -a log_filename
$? would contain the exit value of the tee statement, how can I have the exit value of the rm statement ?