aboutsummaryrefslogtreecommitdiff
path: root/shell/hush_test/hush-misc/assignment1.tests
blob: 033b35250c1cd94e34e3afedb24c4d583bf6b680 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Assignments after some keywords should still work

if a=1 true; then a=1 true; elif a=1 true; then a=1 true; else a=1 true; fi
echo if1:$?
while a=1 true; do a=1 true; break; done
echo while1:$?
until a=1 false; do a=1 true; break; done
echo until1:$?

if a=1 true
 then a=1 true
 elif a=1 true
 then a=1 true
 else a=1 true
 fi
echo if2:$?
while a=1 true
 do a=1 true
 break
 done
echo while2:$?
until a=1 false
 do a=1 true
 break
 done
echo until2:$?

if
 a=1 true; then
 a=1 true; elif
 a=1 true; then
 a=1 true; else
 a=1 true; fi
echo if3:$?
while
 a=1 true; do
 a=1 true; break; done
echo while3:$?
until
 a=1 false; do
 a=1 true; break; done
echo until3:$?