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

7 lines
106 B
Bash

#!/bin/bash
var1=100
var2=45
var3=`echo "scale=4; $var1 / $var2" | bc`
echo The answer for this is $var3