I am new to Bash/Scripting in general and I want to create a basic calculator using Bash. I created this code to just test out if I can make the option to just add for now. Here is my code, feel free to let me know if there are more errors than what I mentioned above.
#! /bin/bash
#echo "Testing Calculator. Enter a number:"
#read NUM1
#echo "Your number is: $NUM1"
MENU_OPTIONS(){
echo "***** Menu Options *****"
echo "1 = ADD"
echo "2 = SUBTRACT"
echo "3 = MULTIPLY"
echo "4 = DIVIDE"
echo "Q = EXIT"
echo "************************"
}
ADDITION(){
echo "Please enter first number:"
read NUM_1
echo "Please enter second number:"
read NUM_2
NUM_3 = NUM_1 + NUM_2
echo "$NUM_1 + $NUM_2 equals $NUM_3"
}
USER_INPUT='a'
while [ $USER_INPUT != "Q" ]; do
MENU_OPTIONS
read USER_INPUT
if [ $USER_INPUT = "1" ]
then
ADDITION
else
echo "Bye."
fi