Dollar sign in Linux Shell $

Source: Internet
Author: User

In Linux Shell, the dollar sign $ in linux often encounters a lot of dollar signs ($). Some symbols are easy to mix up. I will make a record of what they represent: www.2cto.com $0 shell command itself (including the full path) $1 to $9 indicates the shell parameters $ # number of parameters passed to the script $ * display all parameters passed to the script with a single string $ ID of the script running $! The ID of the last process running in the background is $ @ and $. $-Display the current options used by shell. $? Displays the execution status of the last command. 0 indicates no error. For example: www.2cto.com [root @ CentOS haha]/tmp] $. /test. sh p1 p2 $0 is {. /test. sh} $1 is {p1} $2 is {p2} $ * is {p1 p2} $ @ is {p1 p2} $ # is {2} $! Is {}$ $ is {25643 }$? Is {0}

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.