Start 1.33.0 development cycle
[oweals/busybox.git] / shell / hush_test / hush-parsing / and_or_and_backgrounding.tests
1 # According to this doc, && || have higher precedence than ; &.
2 # See example below.
3 # Precedence of ; is not a problem in practice. Precedence of & is.
4 #
5 #http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
6 #
7 #2.9.3 Lists
8 #
9 #An AND-OR list is a sequence of one or more pipelines separated by
10 #the operators "&&" and "||" .
11 #
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>.
14 #
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:
18 #
19 #    false && echo foo || echo bar
20 #    true || echo foo && echo bar
21 #
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.
25
26 echo First && sleep 0.2 && echo Third &
27 sleep 0.1
28 echo Second
29 wait
30 echo Done