bug-bash
[Top][All Lists]
Advanced

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

Re: Failed $(<file) exits under 'set -e' even when followed by ||


From: Chet Ramey
Subject: Re: Failed $(<file) exits under 'set -e' even when followed by ||
Date: Mon, 3 Apr 2023 10:30:29 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

On 3/31/23 10:20 PM, Zev Weiss wrote:

Bash Version: 5.2
Patch Level: !PATCHLEVEL!
Release Status: release

Description:

When 'set -e' is enabled, file-content substitutions of the form $(<...) cause an immediate exit even when the subsitution is in a conditional context such as the condition of an 'if' statement or the left operand of the '||' operator.

It's always been a (fatal) redirection error, but, as you suspect, has a
different effect now that $(<file) is run without forking. I'll change it
to a non-fatal failed word expansion for this case.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

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