bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

set -e in subshell


From: Aron Griffis
Subject: set -e in subshell
Date: Fri, 13 Nov 2020 11:15:11 -0500

GNU bash, version 5.0.17(1)-release (x86_64-redhat-linux-gnu)

$ (set -e; false; echo BANG) || echo whimper
BANG

$ (set -e; false; echo BANG); echo whimper
whimper

The || after the subshell seems to prevent set -e from being effective
inside the subshell.

Is this a bug or does it make sense in a way I don't understand?

Thanks,
Aron


reply via email to

[Prev in Thread] Current Thread [Next in Thread]