出自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[]}參數通過偏移量截取子串操作
新聞熱點
疑難解答