-
Notifications
You must be signed in to change notification settings - Fork 0
/
if.sh
46 lines (38 loc) · 964 Bytes
/
if.sh
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
a=12
b=10
if [ $a -eq $b ]
then
echo " equal "
else
echo " not equal "
fi
if [ $a -ne $b ]
then
echo "[$a -ne $b]: The condition passed as a is not equal to b"
else
echo "[$a -ne $b]: The condition failed as a is equal to b"
fi
if [ $a -gt $b ]
then
echo "[$a -gt $b]: The condition passed as a is greater than b"
else
echo "[$a -gt $b]: The condition failed as a is not greater than b"
fi
if [ $a -lt $b ]
then
echo "[$a -lt $b]: The condition passed as a is less than b"
else
echo "[$a -lt $b]: The condition failed as a is not less than b"
fi
if [ $a -ge $b ]
then
echo "[$a -ge $b]: The condition passed as a is greater than or equal to b"
else
echo "[$a -ge $b]: The condition failed as a is not greater than or equal to b"
fi
if [ $a -le $b ]
then
echo "[$a -le $b]: The condition passed as a is less than or equal to b"
else
echo "[$a -le $b]: The condition failed as a is not less than or equal to b"
fi