1 # According to this doc, && || have higher precedence than ; &.
3 # Precedence of ; is not a problem in practice. Precedence of & is.
5 #http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
9 #An AND-OR list is a sequence of one or more pipelines separated by
10 #the operators "&&" and "||" .
12 #A list is a sequence of one or more AND-OR lists separated by the operators
13 #';' and '&' and optionally terminated by ';', '&', or <newline>.
15 #The operators "&&" and "||" shall have equal precedence and shall be
16 #evaluated with left associativity. For example, both of the following
17 #commands write solely bar to standard output:
19 # false && echo foo || echo bar
20 # true || echo foo && echo bar
22 #A ';' or <newline> terminator shall cause the preceding AND-OR list
23 #to be executed sequentially; an '&' shall cause asynchronous execution
24 #of the preceding AND-OR list.
26 echo First && sleep 0.2 && echo Third &