2015-11-07 108 views
1

在make文件中的以下代码中,@!是什么意思?我检查make manual但是没有找到答案:@是什么意思?在make文件中?

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

这只是一个猜测,但我会说!是'shell'函数的别名(在子shell中调用'git'命令),而@则禁止该命令的输出。 –

+0

这看起来像可以用简单的谷歌搜索来解决,但它不能。我至少在检查'make'手册时给+1。 –

+0

制作部分在这里介绍:http://stackoverflow.com/questions/3477292/what-do-and-do-as-prefixes-to-recipe-lines-in-make – tripleee

回答

2

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

+0

记录使用'!'在[Bash Pipelines]中(https://www.gnu.org/software/bash/manual/bash.html#Pipelines)。 –

+0

@JingguoYao当然我的意思是它没有记录在make中,因为它是bash – Azad