bug-bash
[Top][All Lists]
Advanced

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

Re: :? within a function


From: Robert Elz
Subject: Re: :? within a function
Date: Mon, 18 May 2026 16:02:52 +0700

    Date:        Sun, 17 May 2026 21:47:54 -0400
    From:        Zachary Santer <zsanter@gmail.com>
    Message-ID:  
<CABkLJULG46pLTkP6_u3U+UbD=Vv++D0dJYT9zTe4+UY0JJNPPQ@mail.gmail.com>

  | An interactive shell does not exit, but does not execute the
  | command associated with the expansion and any containing function
  | calls exit with a nonzero status.

That's too specific, the general rule for when a non-interactive shell
would exit because of some condition or other, is that interactive shells
instead abandon all they are doing, whatever it is, and return immediately
to the highest level command prompt (issue PS1 and wait for a new command
with $? set to indicate failure).

I have no reason to believe bash differs from all other shells in this regard,
though it does sometimes wrt the question of whether the event in question is
one which would make a non-interactive shell exit.

kre





reply via email to

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