I tried the following command in bash
echo this || echo that && echo other
This gives the output
this
other
I didn't understand that!
My dry run goes this way :
echo this || echo that && echo otherimpliestrue || true && true- Since,
&&hasmore precedencethan||, the second expression evaluates first - Since,
both are true, the||is evaluated which also gives true. - Hence, I conclude the output to be:
that
other
this
Being from a Java background where && has more precedence than ||, I am not able to relate this to bash.
Any inputs would be very helpful!