shell脚本命令疑问

发布于 2024-10-05 12:30:30 字数 171 浏览 1 评论 0原文

我的 shell 脚本 CONFIGS_ARCHIVE 中有一个命令

CONFIGS="`tar -tzf ${CONFIGS_ARCHIVE}`"

是 tar.gz 文件。如果执行该命令,CONFIGS 的值是什么?

谢谢, Linux彭瑟尔

I have a command in my shell script

CONFIGS="`tar -tzf ${CONFIGS_ARCHIVE}`"

CONFIGS_ARCHIVE is tar.gz file. If the command is executed what will be the value of CONFIGS?

Thanks,
LinuxPenseur

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾城泪 2024-10-12 12:30:30

` 引号用于执行命令。除非您添加`引号,否则 shell 会将该命令视为常规字符串。
如果你想执行一个命令并将其保存到一个变量中,就像你所做的那样,你必须加上`引号

` quote is for executing the command. Unless you put that ` quote, shell will treat that command as a regular string.
If you want to execute a command and save it to a variable like you do, you must put that ` quote

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文