├── Output.png ├── README.md └── mini.sh /Output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hj296/Operating-System-Mini-Project/9ea21938803fb29c62650c41784a83f7d7e6c9ce/Output.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Operating-System-Mini-Project 2 | ATM Transaction using Shell Scripting 3 | 4 | OBJECTIVE: 5 | The prime objective of this mini-project is to enable the user perform various transaction operations based on the balance available in the user’s account. Other objectives may include: 6 | 7 | • Flexibility to the users for performing deposition and withdrawal operations using the software. 8 | • Also helps determine the amount of money left in order to perform withdrawal operation. 9 | • Easy usability of the software makes it really convenient to use. 10 | 11 | 12 | 13 | USE: 14 | This is a simple yet powerful tool that can be used by a user to deposit and withdraw money as and when required. 15 | It also tells the user the amount left in the user’s account to perform withdrawal operation. 16 | 17 | 18 | How to use it? 19 | • The user is displayed 3 options- Withdraw, Deposit and Check Balance. 20 | • Selecting the withdraw option enables the user to perform withdraw option. In case the account balance is 0, an error message will be displayed. After withdrawing, the new balance is displayed. 21 | • Selecting the deposit option enables the user to deposit money in his account. After the deposition, the new balance is displayed. 22 | • The check balance option displays the current account balance. 23 | -------------------------------------------------------------------------------- /mini.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | WITHDRAW=0; 4 | BALANCE=5000; 5 | DEPOSIT=0; 6 | AMOUNT=0; 7 | 8 | 9 | echo "Select your options... 10 | 11 | 1.Cash Withdraw 12 | 13 | 2.Deposit 14 | 15 | 3.Check Balance" 16 | 17 | 18 | 19 | while : 20 | 21 | do 22 | 23 | 24 | read INPUT_INTEGER 25 | 26 | case $INPUT_INTEGER in 27 | 28 | 1) 29 | 30 | 31 | echo "Enter the amount" 32 | 33 | 34 | read AMOUNT 35 | 36 | 37 | 38 | if [ "$AMOUNT" -gt "$BALANCE" ]; then 39 | 40 | { 41 | 42 | echo "Insufficient Funds" 43 | 44 | } 45 | 46 | 47 | else 48 | 49 | 50 | { 51 | 52 | BALANCE=$(($BALANCE - $AMOUNT)); 53 | 54 | echo "Your current balance is ${BALANCE}" 55 | 56 | } fi 57 | 58 | ;; 59 | 60 | 61 | 62 | 2) 63 | 64 | 65 | echo "Enter the amount" 66 | 67 | 68 | read AMOUNT; 69 | 70 | 71 | BALANCE=$(($AMOUNT + $BALANCE)) 72 | 73 | 74 | echo "Your current balance is ${BALANCE}" 75 | 76 | ;; 77 | 78 | 3) 79 | 80 | echo "YOur current balance is ${BALANCE}" 81 | 82 | ;; 83 | 84 | 85 | *) 86 | 87 | echo "Sorry, I don't Understand" 88 | 89 | ;; 90 | 91 | 92 | esac 93 | 94 | done 95 | 96 | done 97 | --------------------------------------------------------------------------------