linux-tutorial/codes/shell/逻辑控制/使用双圆括号.sh

13 lines
150 B
Bash
Raw Normal View History

2019-10-29 18:22:19 +08:00
#!/usr/bin/env bash
# using double parenthesis
var1=10
if (($var1 ** 2 > 90))
then
((var2 = $var1 ** 2))
echo "The square of $var1 if $var2"
fi