Consider this Makfile:
all:
test 1 -eq 2 | cat
echo 'done'
It will be executed with no error.
I've heard of set -o pipefail
that I may use like this:
all:
set -o pipefail; \
test 1 -eq 2 | cat; \
echo 'done'
Apart that it does not work, this writing is very painful.
Another solution would be to use temporary files. I would like to avoid it.
What other solution can I use?
You can force pipefail on as part of make's SHELL invocation From equivalent of pipefail in GNU make?
SHELL=/bin/bash -o pipefail
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With