shell/基本脚本/在脚本中使用bc.sh

7 lines
106 B
Bash
Raw Normal View History

2016-05-13 21:42:54 +08:00
#!/bin/bash
var1=100
var2=45
var3=`echo "scale=4; $var1 / $var2" | bc`
echo The answer for this is $var3