I should add that I realized using {CONDITION} alone is not a reasonable thing in my examples, as it uses exist status. In a real code, one would use ${CONDITION}. The modified script is attached below #####. However, the behavior is still not as expected: ~/tmp $ source ./conditionals-bug.esh It is 2 It is 3 It is NOT 3 It is 4 It is NOT 4 ###################################### # The behavior of conditionals depends on whitespace # Source this script to test it # This formatting works as expected; evaluates the "true" block. # Result: # "It is 2" # if ${= 2 2} { echo "It is 2" } { echo "It is NOT 2" } # This formatting causes a BUG: both the "true" block and the "false" block are evaluated. # I tried several combinations, it appears it the "false" block starts on it's own line, # it is no longer treated a part of the "if" expression. Which could be argued # is expected because there is no "else" that would define whether the second block # is not part of the "if" expression. BUT see next test # # Result: # "It is 3" # "It is NOT 3" # if ${ = 3 3 } { echo "It is 3" } { echo "It is NOT 3" } # BUT we get the same incorrect result if we place the whole if expression into {} { if ${ = 4 4 } { echo "It is 4" } { echo "It is NOT 4" } }