On Mon, Jun 11, 2018 at 6:12 PM, Bartłomiej Palmowski <rotw...@crux.org.pl>
wrote:

>
> The issue is:
> $ cat bad
> (
>     set -e
>     false
>     echo "Shouldn't happen?"
> ) && :
> $ bash ./bad ; echo $?
> Shouldn't happen?
> 0
> $ cat good
> (
>     set -e
>     false
>     echo "Shouldn't happen?"
> )
> $ bash ./good ; echo $?
> 1
>
> Probably there is something obvious that I'm missing.
>

According to bash man page:

> The shell does not exit if the command that fails is [...] part of any
command executed in a && or || list except the command following the final
&& or ||, [...]

-clark

Reply via email to