linux-tutorial/codes/shell/示例脚本/基本脚本/在脚本中使用bc.sh

7 lines
106 B
Bash
Raw Normal View History

2019-05-10 11:17:57 +08:00
#!/bin/bash
var1=100
var2=45
var3=`echo "scale=4; $var1 / $var2" | bc`
echo The answer for this is $var3