bug-bash
[Top][All Lists]
Advanced

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

Re: Bad substitution breaks conditional statement


From: Chet Ramey
Subject: Re: Bad substitution breaks conditional statement
Date: Wed, 14 Oct 2020 09:27:55 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.3.2

On 10/13/20 4:42 PM, Martin Schulte wrote:
> Hi Chet, hi all!
> 
>> In general, variable expansion errors cause posix-mode shells to exit and
>> bash default mode shells to abort execution of the current command and
>> return to the top level, whether that is the command line or the next
>> command in the script. This aborts lists and other compound commands.
>> Bash has always behaved this way.
>>
>> However, invalid parameter transformation operators are not considered
>> fatal errors, even in posix mode. Maybe they should be.
> 
> Yes, please :-)

There are a couple of ways to go. The obvious one is to make it a fatal
error when non-interactive and non-fatal in interactive shells. The posix
mode setting should not matter because this is not a posix expansion.

> 
> Or no error at all.

No, that doesn't seem useful.

Chet

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