On 4/18/19 11:32 AM, Thomas Deutschmann wrote:

> Actual result:
> ==============
> bash-test.sh: line 5: bar=${${foo}_blah}: bad substitution
> Rest of the script
> 
> 
> Expected result:
> ================
> bash-test.sh: line 5: bar=${${foo}_blah}: bad substitution
> I run after the failing_function!
> Rest of the script
> 
> Is my expectation wrong? I am really wondering that the script will
> continue but not in the current if clause...

On a substitution (expansion) error, bash will either exit the shell
(posix mode in a non-interactive shell, since POSIX requires this), or
return to the top level of execution. It doesn't matter whether the shell
is interactive or not. Bash has always behaved this way. In no cases will
it simply continue with the current command.

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

Reply via email to