1 #
2 # Test the if statement
3
4 #### If
5 if true; then
6 echo if
7 fi
8 ## stdout: if
9
10 #### else
11 if false; then
12 echo if
13 else
14 echo else
15 fi
16 ## stdout: else
17
18 #### elif
19 if (( 0 )); then
20 echo if
21 elif true; then
22 echo elif
23 else
24 echo else
25 fi
26 ## stdout: elif
27
28 #### Long style
29 if [[ 0 -eq 1 ]]
30 then
31 echo if
32 echo if
33 elif true
34 then
35 echo elif
36 else
37 echo else
38 echo else
39 fi
40 ## stdout: elif
41