For the location variables in the Linux shell, I have always been unable to spit out and swallow, every time I see do not understand, do not understand the Baidu Google, read and forget, is really chronic pharyngitis ah. Now seriously think about it too, in fact, they have not studied well, just watched some quick things, hurriedly scan, and then to the speed of light forget. Well, not light these, hope and we encourage each other.
The first time you see the position parameter in makefile this thing like [email protected],$^,$<, etc., the positional parameters in the shell also look like this, but the meaning is not the same. In the shell
$#, indicating the number of arguments passed to the script
$*,[email protected], both refer to all parameters passed to the script
$$, this is the PID of the script running, it doesn't seem to matter with the parameters.
$? The exit status of the command, which is where the command result code is saved.
In fact, these things are not difficult. Before even the concept of positional parameters is not, it is easy to confuse it is not surprising.
Location variables in the Linux shell