4

What is the meaning of @! in the following code from a make file? I check the make manual but find no answer:

check:
    @echo "checking for tabs in shell scripts"
    @! git grep -F '    ' -- '*.sh'
Jingguo Yao
  • 7,320
  • 6
  • 50
  • 63
  • This is just a guess, but I'd say the ! is an alias for the `shell` function (invoking the `git` command in a subshell) and the @ is suppressing the output from that command. – Darwin von Corax Nov 07 '15 at 08:10
  • this looks like it can be solved with a simple google search, but it can't. i am giving a +1 for at least checking the `make` manual. – Joseph Farah Nov 07 '15 at 22:15
  • The Make part is covered here: http://stackoverflow.com/questions/3477292/what-do-and-do-as-prefixes-to-recipe-lines-in-make – tripleee Nov 13 '15 at 08:38

1 Answers1

4

! inverts the return value of the command. @ suppresses the echoing of the command itself. Make gives you an error if any of the commands returns a non-zero value. Using ! just inverts the situation. The reason ! is not listed in the manual is that it's bash.

Azad
  • 1,050
  • 8
  • 24