I have a 3 part logic (A or B and C). Logically if A is true then true, or if B and C is true then true; But here is the error

# if (A or B and C)

if [ 1 -eq 1 ] || [ 2 -eq 2 ] && [ 3 -eq 30 ]; then echo “true”; else echo “false”; fi

false (should be true because “and C” is false at the end of the expression, is this a bug? or am I missing something?)

# if (B and C or A)

if [ 2 -eq 2 ] && [ 3 -eq 30 ] || [ 1 -eq 1 ]; then echo “true”; else echo “false”; fi

true (as should be)