出自bash的faq,仔细看看。顺便翻译学习一下。
代码如下:
Section C: Differences from other Unix shells
C:跟其他UNIX shells脚本的区别
C1) How does bash differ from sh, the Bourne shell?
C1) bash和 sh、Bourne shell的区别
This is a non-comprehensive list of features that differentiate bash
from the SVR4.2 shell. The bash manual page explains these more
completely.
这时一个不全面的bash和SVR4.2 shell特性区别的列表,bash手册解释的更详细
Things bash has that sh does not:
bash特有的功能:
long invocation options
长选项的调用
[+-]O invocation option
-l invocation option
`!' reserved word to invert pipeline return value
!叹号保留字对管道返回的值取反
`time' reserved word to time pipelines and shell builtins
time保留字测试管道或内建命令耗时情况
the `function' reserved word
the `select' compound command and reserved word
select复合命令和保留字
arithmetic for command: for ((expr1 ; expr2; expr3 )); do list; done
算术命令:for ((expr1 ; expr2; expr3 )); do list; done
new $'...' and $"..." quoting
新的引用方法$'...' $"..."
the $(...) form of command substitution
$(...) 命令替代用法
the $(<filename) form of command substitution, equivalent to
$(cat filename)
$(<filename)形式的命令的替换,相当于$(cat filename)
the ${#param} parameter value length operator
${#param} 测试参数param的值的长度
the ${!param} indirect parameter expansion operator
${!param} 间接参数扩展操作
the ${!param*} prefix expansion operator
${!param*} 前缀扩展操作
the ${param:offset[]} parameter substring operator
${param:ffset[]}参数通过偏移量截取子串操作
新闻热点
疑难解答