On Mon, Apr 02, 2018 at 04:16:54PM -0500, PRussell wrote: > The above tells us what happens to an unset variable if not using parameter > expansion. > > But if a shell variable uses parameter expansion and is null or unset, what > does it evaluate to inside (()) syntax?
The parameter expansion is performed exactly as you would expect, resulting in an empty string, and most likely a syntax error. > ./tt: line 18: var1: var1 == : syntax error: operand expected (error token > is "== ") Yes, like that. So don't do that. This is a bug in your script, not in bash.