set -e
seems not behave the same in when a subshell is piped to a condition.
Why am I seeing 2
on this script ? With set -e
, the subshell should have fast-fail on false
?
#!/bin/bash
set -e # fail fast
( echo 1; false; echo 2; ) || true
( echo 3; false; echo 4; )
#Output:
1
2
3
New contributor
Philippe BOUGRIER is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.