如何在引号、单引号或反引号中使用通配符或任何其他特殊字符?

How do you use wildcards or any other special character in quotes, single quotes or backtick?

如何在引号、单引号或反引号中使用通配符或任何其他特殊字符?

如何做到 Linux 不会从字面上理解? 例如

echo "This is my list of file ls -l"

我知道他们是另一种方式,例如

echo "This is my list of file" ; ls -l

但我试图将 ls -l 保留在 echo 中。

您可以使用:

echo "This is my list of file $(ls -l)"

这将在 echo 语句中打印 ls -l 的输出。