1
Bash evaluates the logical operators such that && always takes precedence. So for example:
false || echo 1 && echo 2
1
2
and
true || echo 1 && echo 2
2
Ok. So lets say I want the output to be like this:
false || (echo 1 && echo 2)
But without invoking a subshell.
The only solution I could think of is this:
false || if true; then echo 1; echo 2; fi
1
2
Is there any cleaner way, similar to parenthesis in C, to group commands together without having to invoke a subshell?
In retrospect, this should probably have been posted on stackoverflow. – Zhro – 2014-10-28T10:53:11.190
No, it's also fine to ask here. – slhck – 2014-10-28T11:22:33.477