forked from vilasvarghese/devops
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelationaloper.sh
More file actions
64 lines (55 loc) · 1.12 KB
/
Copy pathrelationaloper.sh
File metadata and controls
64 lines (55 loc) · 1.12 KB
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
58
59
60
61
62
63
64
#!/bin/bash
#Purpose: Relational Operators examples
#Version:1.0
#Created Date: Thu May 10 22:43:16 IST 2021
#Modified Date:
# Website: WIP
#Author: Vilas Varghese
# START #
echo -e "Please provide one number: \c"
read -r h
echo -e "Please provide one number: \c"
read -r g
test $h -lt $g;echo "$?";
test $h -le $g;echo "$?";
test $h -gt $g;echo "$?";
test $h -ge $g;echo "$?";
test $h -eq $g;echo "$?";
test $h -ne $g;echo "$?";
if [ $h -eq $g ]
then
echo "$h -eq $g : h is equal to g"
else
echo "$h -eq $g: h is not equal to g"
fi
if [ $h -ne $g ]
then
echo "$h -ne $g: h is not equal to g"
else
echo "$h -ne $g : h is equal to g"
fi
if [ $h -gt $g ]
then
echo "$h -gt $g: h is greater than g"
else
echo "$h -gt $g: h is not greater than g"
fi
if [ $h -lt $g ]
then
echo "$h -lt $g: h is less than g"
else
echo "$h -lt $g: h is not less than g"
fi
if [ $h -ge $g ]
then
echo "$h -ge $g: h is greater or equal to g"
else
echo "$h -ge $g: h is not greater or equal to g"
fi
if [ $h -le $g ]
then
echo "$h -le $g: h is less or equal to g"
else
echo "$h -le $g: h is not less or equal to g"
fi
# END #