shell/基本脚本/使用方括号执行数学运算.sh

8 lines
102 B
Bash

#!/bin/bash
var1=10
var2=50
var3=45
var4=$[$var1 * ($var2 - $var3)]
echo 'The final result is '$var4