Shell variables:

Source: Internet
Author: User

Shell variables:
(1) The variable and the variable content are connected with the equal sign "=;
(2) The equal signs cannot be directly followed by space characters;
(3) The variable name can only contain English letters and numbers, but cannot start with a number;
(4. if there is a space character, you can use double quotation marks "or single quotation marks" '"to combine the variable content, but pay special attention to the fact that special characters in double quotation marks can retain the variable property, however, special characters in single quotes are only common characters;
(5) If necessary, use the Escape Character "/" to convert special characters (such as enter, $,/, space character, and ') into general characters;
(6. in a string of commands, you can use quote 'command' for the information provided by other commands '』;
(7) If the variable is an expanded variable, you must add the variable content with double quotation marks and $ variable names such as "$ path":/home;
(8. If the variable needs to be in another sub-ProgramExecute, you need to use export to make the variable action, such as "Export path 』;
(9. Generally, upper-case characters are system preset variables. You can use lower-case characters to set variables for easy judgment (purely based on user interests and hobbies );
(10. The method for canceling a variable is "Unset variable name 』.

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.