bug-bash
[Top][All Lists]
Advanced

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

Re: inconsistent readonly error behavior


From: Chet Ramey
Subject: Re: inconsistent readonly error behavior
Date: Wed, 23 Dec 2020 11:19:54 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.5.1

On 12/23/20 11:10 AM, Travis Everett wrote:
I think I'm missing or misreading something. If I understood, the assignment and expansion errors are both shell errors that should have the same exit behavior?

But I see the assignment error ending the list and returning to the top level, and the expansion exiting the script:

That's not an expansion error.


if true; then
echo ${bad:?word}
echo reached3
fi
echo reached4

This is a well-defined expansion whose behavior is to exit a non-interactive shell if `bad' is unset or null.

--
``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]