The first backquote not preceded by a backslash terminates the command substitution.
不带反斜杠的第一个后引号终止命令替换。
What we did above is called "command substitution".
上面所做的称为“命令替换”。
You saw an example of command substitution in Listing 9 when we created a captive TAB character.
我们曾经在清单9中创建了一个强制制表符,您可以从中看到命令替换的例子。
If you prefer, you can use the back-ticks for command substitution. It achieves the same result.
如果愿意,可以使用反撇号进行命令替换。
In Listing 9 we create a captive TAB character using command substitution and then create a very small shell script containing two cat commands, which each read from a here-document.
在清单9中,我们使用命令行替换创建了一个强制制表符,然后创建了一个包含两个cat命令的shell脚本,这两个命令都从here - document读取数据。
Command substitution is used at the command line, but more frequently in scripting; you will learn more about it and scripting in later articles of this series.
可以在命令行上使用命令替换,但在脚本中使用它则更常见;您将在本系列的后续文章中更多地了解它和脚本。
Command substitution is used at the command line, but more frequently in scripting; you will learn more about it and scripting in later articles of this series.
可以在命令行上使用命令替换,但在脚本中使用它则更常见;您将在本系列的后续文章中更多地了解它和脚本。
应用推荐