More cases:

Code:
;; 1 - 2 (incorrect)
if (1 == 2) || 2 == 2 echo -a $v1 - $v2

;; 1 - 1 (incorrect)
if (1 == 1) && 2 == 2 echo -a $v1 - $v2

;; 2 - 2 (correct)
if 1 == 2 || (2 == 2) echo -a $v1 - $v2
if (1 == 2) || 2 == 2 { echo -a $v1 - $v2 }

;; 2 - 2 (correct)
if 1 == 1 && (2 == 2) echo -a $v1 - $v2
if (1 == 1) && 2 == 2 { echo -a $v1 - $v2 }


An observation: Wrapping the command body in {}'s seems to remove all strangeness thus $v1/$v2 are set to expected/consistent values for the same condition block regardless of how the block is formatted with ()'s [assuming that the alternative formatting of the condition does not change how its processed]

Last edited by FroggieDaFrog; 15/07/17 02:01 AM.

I am SReject
My Stuff