-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·57 lines (48 loc) · 769 Bytes
/
test.sh
File metadata and controls
executable file
·57 lines (48 loc) · 769 Bytes
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
ls -l '/'
w
iostat
b=0
echo $b
echo b
c=$(( b+2 ))
echo $c
a=0
if [[ $a == 0 ]];
then
echo "condition is true";
else
echo "condition is false";
fi
a=$((a++))
if [[ $a == 0 ]];
then
echo "condition is true";
else
echo "condition is false";
fi
iterator=0
while true;
do
iterator=$(( iterator+1 ))
if [[ $iterator == 5 ]]; then
echo "In loop..."
break;
fi
done
echo "I just broke out of loop."
iterator=0
while [[ $iterator == 0 ]];
do
echo "In loop"
iterator=$((iterator + 1))
done
echo "The loop condition is not true anymore, so stopped looping."
iterator=0
while [[ $iterator <= 5 ]];
do
iterator=$((iterator++))
if [[ $iterator <= 4 ]]; then
continue;
fi
echo 'If continue works this line should be printed twice.'
done