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

13 lines
148 B
Bash
Raw Normal View History

2019-05-10 11:17:57 +08:00
#!/bin/bash
2019-10-10 08:56:31 +08:00
2019-05-10 11:17:57 +08:00
# using double parenthesis
var1=10
2019-10-10 08:56:31 +08:00
if (($var1 ** 2 > 90))
then
((var2 = $var1 ** 2))
echo "The square of $var1 if $var2"
2019-05-10 11:17:57 +08:00
fi