I am trying to build a very basic 4 function arithmetic script in UNIX and it doesn't like my arithmetic statement. I was trying to use 'bash arithmetic' syntax
from this source
http://faculty.salina.k-state.edu/tim/unix_sg/bash/math.html
also as a side note when you reference a variable in UNIX when do you need to use the "$" symbol, and when do you not need to?
#!/bin/bash
str1="add"
str2="sub"
str3="div"
str4="mult"
((int3=0))
((int2=0))
((int1=0))
clear
read -p "please enter the first integer" $int1
clear
read -p "Please enter mathmatical operator'" input
clear
read -p "Please enter the second integer" $int2
if [ "$input" = "$str1" ];
then
((int3 = int1+int2))
echo "$int3"
else
echo "sadly, it does not work"
fi;