Linux single quotes, double quotes, small summaries of back quotes.

Source: Internet
Author: User

Or the old routine to say the cause of things, because the first of the various quotes under Linux is not particularly sensitive, resulting in the day I add Database field errors, the reason for the error was that I used a single quotation mark in the outermost package, Then a sentence in which the need to change the meaning of the place can not be transferred to cause the error.

Let's start with a single quote.

Single quotes:

In order to protect the text from being converted, all the text inside the single quotation marks is output as is, except for herself, that is, excluding the single quotation mark itself.

Get results
Export

Get results
$export

From here you see that export is not being executed. And I didn't print out the information.

Look at one more example.

Echo "" " 
Get results

Nothing has been mentioned above, single quotes cannot output itself.

Double quotes:

In order to contain text or function segments, the rest can be output directly, except for itself, the function within the inverted quotation mark, the variable starting with $, and the forward character of \.

Echo " Export " Get Results Export Echo " $export " Get Results Export

Anti-quote:

The play came to the use of the reaction number is actually more interesting, the anti-quote can let the wrapped thing to keep the function of conversion or execution of the wrapped statement let us look directly at the example.

Echo " Export " Get Results Export Echo " $export " Get Results Export Echo " ' Export ' " get the result a big lump of export things. 

It can be seen that the anti-quote can be reversed to the partial execution after the output. Isn't that great?

More tips to explore more.

Linux single quotes, double quotes, small summaries of back quotes.

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.