Piping command output to tee but also save exit code of command [duplicate] Piping command output to tee but also save exit code of command [duplicate] shell shell