没有合适的资源?快使用搜索试试~ 我知道了~
首页csh,tcsh,bash,sh等shell的区别
资源详情
资源评论
资源推荐

csh,tcsh,bash,sh等等shell的区别的区别
主要介绍了linux下csh, tcsh,bash, sh等shell的区别?,需要的朋友可以参考下
出自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[]}参数通过偏移量截取子串操作
the ${param/pat[/string]} parameter pattern substitution operator
${param/pat[/string]} 参数模式替换的操作
expansions to perform substring removal (${p%[%]w}, ${p#[#]w})
扩展子串删除命令:(${p%[%]w}, ${p#[#]w})
expansion of positional parameters beyond $9 with ${num}
扩展了为止参数超过9的限制
variables: BASH, BASH_VERSION, BASH_VERSINFO, UID, EUID, REPLY,
TIMEFORMAT, PPID, PWD, OLDPWD, SHLVL, RANDOM, SECONDS,
LINENO, HISTCMD, HOSTTYPE, OSTYPE, MACHTYPE, HOSTNAME,
ENV, PS3, PS4, DIRSTACK, PIPESTATUS, HISTSIZE, HISTFILE,
HISTFILESIZE, HISTCONTROL, HISTIGNORE, GLOBIGNORE, GROUPS,
PROMPT_COMMAND, FCEDIT, FIGNORE, IGNOREEOF, INPUTRC,
SHELLOPTS, OPTERR, HOSTFILE, TMOUT, FUNCNAME, histchars,
auto_resume
上边一堆的环境变量
DEBUG trap
ERR trap
调试和错误陷阱
variable arrays with new compound assignment syntax
数组和复合赋值运算符的语法规则



















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0