2019独角兽企业重金招聘Python工程师标准>>>
March 25 2018 Sunday
Weather:cloudy
1、需求:
a=0.5 b=3 c=a*b 求c的值:
[root@Dasoncheng sbin]# cat a.sh
#!/bin/bash
a=0.5
b=3
c=`echo $a*$b |bc`
echo $c
answer referred:
[root@Dasoncheng sbin]# cat a.sh
#!/bin/bash
a=0.5
b=3
c=`echo "scale=1;$a*$b" |bc`
echo $c