How bash Expands a Command Line

1066阅读 0评论2008-10-18 一路征程一路笑
分类:LINUX

How bash Expands a Command Line

1. Split the line into words

2. Expand aliases

3. Expand curly-brace statements ({})

4. Expand tilde statements (~)

5. Expand variables ($)

6. Command-substituation ($() and ``)

7. Split the line into words again

8. Expand file globs (*, ?, [abc], etc)

9. Prepare I/O redirections (<, >)

10. Run the command!

上一篇:Linux内核源代码目录树结构
下一篇:Linux initrd的分析、创建和使用