num1 = 20
num2 = 20
echo $(( num1 + num2 ))
echo $(( num1 - num2 ))
echo $(( num1 * num2 ))
echo $(( num1 / num2 ))
echo $(( num1 % num2 ))
Error :
./practice.sh: line 53: num1: command not found
./practice.sh: line 54: num2: command not found
0
0
0
./practice.sh: line 59: num1 / num2 : division by 0 (error token is "num2 ")
./practice.sh: line 60: num1 % num2 : division by 0 (error token is "num2 ")
What am I missing? When I tried some number instead of num1
and num2
inside echo. I notice that it was printing correctly.. But, What is happening right here..?
=
in an assignment. – Kusalananda Apr 06 '21 at 07:11=
on the first 2 lines. – fpmurphy Apr 06 '21 at 07:12