Linux shell programming-variables and references

Source: Internet
Author: User

Linux shell programming ---- variables and References 1 variable 1 variables are used to save useful information, such as path names and file names. variables are essentially one or more memory addresses. 2 variables are divided into three local variables: variables that can only be used in the script of the Current shell life cycle. The environment variable is invalid as the shell process disappears: applicable to all the child process location parameters generated by the login process: used to pass parameters to shell, is the value of the read-only 3 variable = value/1 equals sign can not have space on both sides 2 if there is a space in the value must use "" to Enclose 3 variable names can only include uppercase and lowercase letters, numbers, and variable names cannot start with a number, it can be used to clear the value of the variable. In shell 5, the variable has only two types of Integer type and character type 2 references. 1 references the string and causes it with a reference symbol, to prevent special characters from being interpreted as other meanings by shell scripts, special characters refer to characters that can be interpreted as other meanings in addition to literal meanings. For example, the $ symbol literally means the dollar symbol, however $ In a regular expression, it also indicates the end of the line and can replace variables. 2. Four types of symbolic symbols in shell Name meaning "" Double quotation marks reference except $, \ All characters other than ''single quotation marks reference all characters except escape character. In shell, the content of the quotation marks is interpreted as a system command \ backslash escape character, meaning shielding the next character 3 echo 1 echo function is to print a piece of text on the display, description and description 2 echo command syntax echo Option string 3 echo options have two-e options to indicate that the escape character is followed by a special character to be interpreted as a special meaning-n Option it indicates that no line breaks are generated after the output text, echo is a line feed by default.

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.