On Tue, Sep 9, 2025, at 7:19 AM, Greg Wooledge wrote:
>> Bash will exit on non-success exit code of the first awk statement,
>> so the if statement will be incorrectly evaluated.
>
> If bash is actually *exiting*, that implies that set -e may be in effect,
> which opens up a whole new dimension of excitement.
>
> This entire bug report might boil down to "I used set -e and didn't
> understand the consequences".

But assuming OP was doing something like

        set -e
        if awk ... && awk ...
        then
                whatever
        fi

neither of the awk commands' exit statuses ought to cause the shell
to exit, since the first part of an "if" command isn't subject to
set -e and doesn't affect its overall exit status.  I suspect "Bash
will exit" is an exaggerated reference to the short-circuiting of
AND- and OR-lists.

In any case, without more information this is all just speculation.

Also, everyone please remember that OP will probably never read any
of this.

-- 
vq

Reply via email to