This question already has answers here:
bash: $[<arithmetic-expression>] vs. $((<arithmetic-expression>))
(2个答案)
Brackets ${}, $(), $[] difference and usage in bash
(1个答案)
6年前关闭。
这两者有什么区别?例子:
$ echo $((1+1))
2
$ echo $[1+1]
2

As shown hereChapter 10, Section 2时。

最佳答案

$[expression]是不推荐使用的语法,以完成相同的任务。

关于bash - 括号和双括号之间的区别? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18235507/

10-16 16:14