I was trying to make a calculator in bash and everything except multiplication works.My script turns "*" into 0 when I try to multiply.There is the code:
#!/bin/bashcalculator(){ if [ $3 = "+" ] ; then echo [ $1 $3 $2 ] else if [ $3 = "-" ] ; then echo [ $1 $3 $2 ] else if [ $3 = "/" ] ; then echo [ $1 $3 $2 ] else if [ $3 = "*" ] ; then echo [ $1 $3 $2 ] else echo "$3 error" fi fi fi fi}calculator 1 2 *