The difference between single quotes, double quotes, and unquoted expressions in a Linux regular expression

Source: Internet
Author: User

1. Single quotes:

What can be said to be WYSIWYG: what you see in a single quote will output what. The contents of the enclosed quotation mark do not occur if the constant or the variable is replaced.

2. double quotes:

Output The contents of the double quotation marks, if there are commands, variables, etc., the variables, commands will first parse the results , and then in the output of the final content, the content constant or constant is surrounded by double quotes, the variable will be replaced, Replace with variable content.

3. No quotation marks:

The string containing the space will not be treated as a whole output, if the contents of the command, variables, etc., will first parse the variables, commands, and then output the final content, if the string with a space and other special characters, it will not be complete output, need to add double quotation marks, General continuous string, number, path, etc. can be used.

Usage Rules:

General constants are enclosed in single quotation marks, and if they contain variables, enclose them in double quotation marks.

Maximum difference:

The maximum difference between a single quote and a double quote is that the double quotation marks can still hold the contents of the variable, but the single quote can only be a generic word

The yuan, without special symbols


The difference between single quotes, double quotes, and unquoted expressions in a Linux regular expression

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.