shell/基本脚本/使用内联重定向计算表达式.sh

16 lines
174 B
Bash
Raw Normal View History

2016-05-13 21:42:54 +08:00
#!/bin/bash
var1=10.45
var2=43.67
var3=33.2
var4=71
var5=`bc <<EOF
scale=4
a1 = $var1 * $var2
b1 = $var3 * $var4
a1 + b1
EOF
`
echo The final answer for this mess is $var5