I've programmed in C++ for a while and recently decided to try to learn a bit of Linux and am just trying to do a simple little calculator and I'm having a bunch of trouble.
I'm skipping most of the stupid code that isn't necessary aka most of the echos and user prompts
but:
The user is prompted to enter two numbers NUM1 and NUM2, after which they have another prompt to select which operator to use.
Code:
echo -n "please enter the first number"
read NUM1
echo -n "Please enter the second number."
read NUM2
echo -n "Please enter which operator you would like to use"
read selection
case $selection in
m) let ans=NUM1*NUM2; echo $ans;;
*) echo -n "Please enter proper data"
esac
echo " "
the output gives me a '0' every time..why is that?
edit: this is only one of the cases because that's as far as I've gotten so far, it will be doing more.