bug-bash
[Top][All Lists]
Advanced

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

Re: set -e doesn't trigger when command substitutions returns, why?


From: Robert Elz
Subject: Re: set -e doesn't trigger when command substitutions returns, why?
Date: Thu, 19 Jun 2025 17:50:20 +0700

    Date:        Thu, 19 Jun 2025 09:27:20 +0200
    From:        microsuxx <fxmbsw7@gmail.com>
    Message-ID:  
<CAALKErHFcEEvDA87cOD74eHvAmCTOpNuKFkwexSu4F3RgHAW2g@mail.gmail.com>

   | bash -e -c 'echo $(exit 1) ; wait -n ; echo survived'

You really need to stop proposing nonsense when you have no idea
what is happening, or why:

        bash -ec 'true; wait -n; echo survived'

no output.   The wait -n is returning an error, there's nothing
to wait for, the '-e' test is detecting that failing.  What
came before is irrelevant.   The same in your case (try exit 0).

kre



reply via email to

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