What's the difference between $(…) and `…`

前端 未结 3 724
一整个雨季
一整个雨季 2021-01-11 17:41

The question is as simple as stated in the title: What\'s the difference between the following two expressions?

$(...)
`...`

For example, a

3条回答
  •  伪装坚强ぢ
    2021-01-11 18:37

    You might want to read man bash:

    When the old-style backquote form of substitution is used, backslash retains its literal meaning except when followed by $, `, or . The first backquote not preceded by a backslash terminates the command substitution. When using the $(command) form, all characters between the parentheses make up the command; none are treated specially.

    That's under the "Command Substitution" section of the manpage.

提交回复
热议问题