Machine Type: x86_64-pc-linux-gnu
Bash Version: 5.2
Patch Level: 21
Release Status: release
Description:
I wrote a script in which I accidentally omitted a semicolon after a
]] and before a then. It didn't work for a colleague of mine using
another version of Bash.
Expectation: I expect a syntax error in the absence of a semicolon
or a newline between the closing brackets and the then.
Behavior with Bash 5.2.21: no error, the program behaves as if a
semicolon was present.
Repeat-By:
Run the following snippet:
if [[ -z "" ]] then
echo hello
fi
Expected behavior: syntax error
Actual behavior: prints "hello"
Fix: (none provided)