Bash performs the expansion by executing command and replacing the command substitu-
tion with the standard output of the command, with any trailing newlines deleted.
Embedded newlines are not deleted, but they may be removed during word splitting.
The command substitution $(cat file) can be replaced by the equivalent but faster
$(< file).
[color=Red]When the old-style backquote form of substitution is used, backslash retains its
literal meaning except when followed by $, `, or \. The first backquote not pre-
ceded by a backslash terminates the command substitution.[/color] (請(qǐng)問(wèn)怎么理解反斜杠保留了他的字面意思??) When using the $(command)
form, all characters between the parentheses make up the command; none are treated
specially.
Command substitutions may be nested. To nest when using the backquoted form, escape
the inner backquotes with backslashes.
If the substitution appears within double quotes, word splitting and pathname expan-
sion are not performed on the results.
復(fù)制代碼
作者: tc1989tc 時(shí)間: 2015-11-12 10:36
...skipping...
$(command)
or
`command`
Bash performs the expansion by executing command and replacing the command substitu-
tion with the standard output of the command, with any trailing newlines deleted.
Embedded newlines are not deleted, but they may be removed during word splitting.
The command substitution $(cat file) can be replaced by the equivalent but faster
$(< file).
When the old-style backquote form of substitution is used, backslash retains its
literal meaning except when followed by $, `, or \. The first backquote not pre-
ceded by a backslash terminates the command substitution. (請(qǐng)問(wèn)怎么理解反斜杠保留了他的字面意思啊??) When using the $(command)
form, all characters between the parentheses make up the command; none are treated
specially.
Command substitutions may be nested. To nest when using the backquoted form, escape
the inner backquotes with backslashes.
If the substitution appears within double quotes, word splitting and pathname expan-
sion are not performed on the results.作者: 農(nóng)民伯伯丶 時(shí)間: 2015-11-12 11:06 回復(fù) 5# tc1989tc