I found this in a embedded in a Makefile:
awk '/@/{print " \"" $$_ "\\n\"" }' file
I know the prototype of awk is:
awk 'pattern {action}' file
But what does @ and $$_ mean?
It looks like the underscore character is simply a variable in this case. And since it is not initialized, it has the value of zero. Thus, $_ is equivalent to $0, which refers to the entire line that was processed. I think that it could also have been written $x since x would be an uninitialized variable.
Since it appears in a makefile, two dollar signs are needed (it is a special character in a makefile) to produce a single dollar sign in the command.
And as already mentioned by Nemo, the @ is simply the pattern. Any line containing @ would be matched.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With