http://scm.zoomquiet.io/data/20071031095335/index.html
http://outofmemory.cn/shell/tutorial/subshells.html
-
( 命令1; 命令2; 命令3; ... )
-
嵌在圆括号里的一列命令在一个子shell里运行.
![]() | 在子shell里的变量不能被这段子shell代码块之外外面的脚本访问.这些变量是不能被产生这个子shell的父进程(parent process)存取的,实际上它们是局部变量(local variables). |
用"|"管道操作把I/O流重定向到子shell,例如ls -al | (command).
![]() | 在一个花括号内的代码块不会运行一个子shell. { command1; command2; command3; ... } |