1 #!/bin/bash 2 while : 3 do 4 read -p "请输入计算规则:" JS 5 if [ -z $JS ];then 6 exit 7 else 8 #echo "$JS=`echo $JS |bc`" 9 echo $JS=`awk BEGIN"{print $JS}"` 10 fi 11 done
1 #!/bin/bash 2 while : 3 do 4 read -p "请输入计算规则:" JS 5 if [ -z $JS ];then 6 exit 7 else 8 #echo "$JS=`echo $JS |bc`" 9 echo $JS=`awk BEGIN"{print $JS}"` 10 fi 11 done