I would like to make a pipeline of Bash scripts like this prog1 | prog2 such that prog2 can see the exit code of prog1 and act differently based on that information. Is this possible?
The .DELETE_ON_ERROR target will tell make to delete a target if a rule fails. But this doesn't work for pipelines, because the exit status value $? holds the value of the last program in the ...
I have two processes foo and bar, connected with a pipe: $ foo | bar bar always exits 0; I'm interested in the exit code of foo. Is there any way to get at it?