不知道怎么回事老说我第14行有错,看半天看不出来,怎么解决啊
#!/bin/bash
read -t 30 -p "please input num1: " num1
read -t 30 -p "please input num2: " num2
read -t 30 -p "please input operator: " op
if [ -n "$num1" -a -n "$num2" -a -n "$op" ]
then
test1=$(echo $num1 | sed 's/[0-9]//g')
test2=$(echo $num2 | sed 's/[0-9]//g')
if [ -z "$test1" -a -z "$test2" ]
then
if[ "$op" == '+' ]
then
res=$(($num1+$num2))
elif[ "$op" == '-' ]
then
res=$(($num1-$num2))
elif[ "$op" == '*' ]
then
res=$(($num1*$num2))
elif[ "$op" == '/' ]
then
res=$(($num1/$num2))
else
echo "yunsuanfu shuru cuowu !!!"
exit 10
fi
else
echo "shuru shuzi cuowu!!!"
exit 11
fi
else
echo "qing shuru neirong"
exit 12
fi
echo " $num1$op$num2=$res "