-
Notifications
You must be signed in to change notification settings - Fork 4
/
mini.sh
96 lines (41 loc) · 774 Bytes
/
mini.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh
WITHDRAW=0;
BALANCE=5000;
DEPOSIT=0;
AMOUNT=0;
echo "Select your options...
1.Cash Withdraw
2.Deposit
3.Check Balance"
while :
do
read INPUT_INTEGER
case $INPUT_INTEGER in
1)
echo "Enter the amount"
read AMOUNT
if [ "$AMOUNT" -gt "$BALANCE" ]; then
{
echo "Insufficient Funds"
}
else
{
BALANCE=$(($BALANCE - $AMOUNT));
echo "Your current balance is ${BALANCE}"
} fi
;;
2)
echo "Enter the amount"
read AMOUNT;
BALANCE=$(($AMOUNT + $BALANCE))
echo "Your current balance is ${BALANCE}"
;;
3)
echo "YOur current balance is ${BALANCE}"
;;
*)
echo "Sorry, I don't Understand"
;;
esac
done
done