【问题标题】:What is the meaning of @! in a make file?是什么意思 @!在制作文件中?
【发布时间】:2016-02-08 07:14:05
【问题描述】:

以下来自make文件的代码中@!的含义是什么?我检查了make manual,但没有找到答案:

check:
    @echo "checking for tabs in shell scripts"
    @! git grep -F '    ' -- '*.sh'

【问题讨论】:

  • 这只是一个猜测,但我会说!是shell 函数的别名(在子shell 中调用git 命令),@ 正在抑制该命令的输出。
  • 这看起来可以通过简单的谷歌搜索来解决,但它不能。我给至少检查make手册+1。
  • Make 部分在这里介绍:stackoverflow.com/questions/3477292/…

标签: makefile


【解决方案1】:

! 反转命令的返回值。 @ suppresses the echoing of the command itself。如果任何命令返回非零值,Make 会给您一个错误。使用! 只是颠倒了情况。手册中没有列出! 的原因是它是 bash。

【讨论】:

  • ! 的用法记录在 Bash Pipelines 中。
  • @JingguoYao 当然我的意思是它没有记录在make中,因为它是bash
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-10-27
  • 2015-07-15
  • 2018-07-17
  • 2012-08-13
  • 2018-05-25
  • 2011-04-16
相关资源
最近更新 更多