- 论坛徽章:
- 93
|
回复 6# Shell_HAT
嗯,不过听说反引号不能嵌套,所以就觉得$()更好了。- [seesea@UC ~]$ echo `echo `echo abc``
- echo abc
- [seesea@UC ~]$ echo $(echo $(echo abc))
- abc
复制代码 不过看说明bash2.0就开始支持了,应该适用性还是挺广的:
While very easy to type (an important factor for an interactive command processor) the backquote notation has been criticized[1] for being awkward to nest, putting one command substitution inside another, because both the left and the right delimiters are the same. To solve this problem, bash 2.0[2] and the Korn shell (ksh)[3] introduced an alternative notation, $( ... ), borrowing from the notational style used for variable substitution: |
|