Piping command output to tee but also save exit code of command [duplicate]
This question already has answers here: Pipe output and capture exit status in Bash (15 answers) Closed 8 years ago. I have a shell script in which I wrap a command (mvn clean install), to redirect the output to a logfile. #!/bin/bash … mvn clean install $@ | tee $logfile echo $? # Does not … Read more