Linux Getting Started--shell script Common information summary

Source: Internet
Author: User
Tags arithmetic

$ default variable in 1.shell

  

$n $ $ for the first argument, and $ for the second argument ... $# Number of command-line arguments the name of the current program               $? The return code of the previous command or function returns 0 for success $* with "parameter 1 parameter 2 ... "Format Save all parameters [email protected] with" parameter 1 "" Parameter 2 "... form to save all parameters $$ This program (process ID number) PID

2. Common parentheses Usage

string comparison  use double brackets [ []]; arithmetic comparison with single brackets []--left and right spaces

arithmetic operations with double parentheses (()); Shell commands and output parentheses ()--left and right without spaces

  full parentheses usage, reference : http://blog.csdn.net/ztf312/article/details/52317571

Linux Getting Started--shell script Common information summary

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.