Fix the test for the Bash version for shellcheck#142
Fix the test for the Bash version for shellcheck#142rcaloras merged 2 commits intorcaloras:masterfrom
Conversation
|
Actually, another option would be to use |
|
Nah I definitely prefer arithmetic contexts, but swapping from the legacy pattern to them in code specifically checking for legacy environments is more risky than normal. As noted in the earlier thread in #141 "As you say very old versions of Bash support arithmetic contexts (2.0, according to https://mywiki.wooledge.org/BashFAQ/061) and the -z will short-circuit older versions." So I think this is safe. |
|
Thanks for the additional commit! |
|
Is this PR still needed as well? @dimo414 feel free to merge if needed. |
|
For the current master of The same error seems to be produced also in the latest version of shellcheck at shellcheck.net. |
I have separated this commit from #141 as suggested by @dimo414 (#141 (comment)).
As in the cover of #141, we seem to need to update the version check due to the shellcheck updates:
Also