Location variables in the Linux shell

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.