[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bad substitution breaks conditional statement
From: |
Lawrence Velázquez |
Subject: |
Re: Bad substitution breaks conditional statement |
Date: |
Mon, 12 Oct 2020 04:11:13 -0400 |
> On Oct 12, 2020, at 1:23 AM, Martin Schulte <gnu@schrader-schulte.de> wrote:
>
> It looks as if a bad substitution detected inside a case of if continues the
> script flow immediately after the conditional statement skipping the
> remaining statements inside the conditional. Please take a look into section
> "Repeat-By:".
It does not really have to do with "conditionals" per se. You can
observe similar behavior with standalone lists.
% bash --version | head -n 1
GNU bash, version 5.0.17(1)-release (x86_64-apple-darwin18.7.0)
% cat /tmp/pe-test
: "${x!y}"
echo foo
{
: "${x!y}"
echo no bar
}
echo bar
: "${x!y}"; echo no baz
echo baz
% bash /tmp/pe-test
/tmp/pe-test: line 1: ${x!y}: bad substitution
foo
/tmp/pe-test: line 5: ${x!y}: bad substitution
bar
/tmp/pe-test: line 8: ${x!y}: bad substitution
baz
--
vq