What's the difference between "echo" and "@echo" in the unix world?
I can't even google special characters.
For example, as used here
When echoing something to a file, >> appends to the file and > overwrites the file.
Printf provides for the creation of a formatting string and offers a non-zero quit status when it fails. Whereas echo normally leaves with a 0 status and typically outputs inputs headed by the end of line character upon this standard result. The “printf” gives you more options for the output format than the “echo”.
There is no difference if you do not put $* or $@ in quotes. But if you put them inside quotes (which you should, as a general good practice), then $@ will pass your parameters as separate parameters, whereas $* will just pass all params as a single parameter.
So basically, $# is a number of arguments given when your script was executed. $* is a string containing all arguments. For example, $1 is the first argument and so on. This is useful, if you want to access a specific argument in your script.
That's a Makefile-specific thing; it has nothing to do with shell scripts.
Recipes that begin with @
do not echo the command. That is to say, with a Makefile
foo:
echo foo
You get
$ make foo # <-- this is meant to be the command you enter in the shell
echo foo
foo
Whereas with a Makefile
foo:
@echo foo
it is
$ make foo
foo
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