一.小括号,圆括号() 1.单小括号 () ①命令组.括号中的命令将会新开一个子shell顺序执行,所以括号中的变量不能够被脚本余下的部分使用.括号中多个命令之间用分号隔开,最后一个命令可以没有分号,各命令和括号之间不必有空格. ②命令替换.等同于`cmd`,shell扫描一遍命令行,发现了$(cmd)结构,便将$(cmd)中的cmd执行一次,得到其标准输出,再将此输出放到原来命令.有些shell不支持,如tcsh. ③用于初始化数组.如:array=(a b c d) …
conditional expressions are used by the [[ compound command and the test and [ builtin commands. arithmetic expression 共有三个 [[,test,[ Shell中[和[[的异同 test判断方式: [ ] 不支持Shell中提供的各种通配符状态判断的方式:[[ expr ]],和test不同的是,该方式中的表达式支持通配符,在[[ expression ]]中,expressio…