bash中字符串插值命令的输出

bash中字符串插值命令的输出,bash,Bash,如何像这样回显节点位置: echo "node can be found at the following location ${which node}" 这将导致严重的替换错误。您可以使用: echo "node can be found at the following location $(which node)" $()是一个子shell,您可以在中了解更多信息:使用echo“节点可以在以下位置找到$(注意)”${}被调用。您需要的是($())。

如何像这样回显节点位置:

echo "node can be found at the following location ${which node}"
这将导致严重的替换错误。

您可以使用:

echo "node can be found at the following location $(which node)"
$()
是一个子shell,您可以在中了解更多信息:

使用
echo“节点可以在以下位置找到$(注意)”
${}
被调用。您需要的是(
$()
)。