Three the difference and usage of quotation marks

Source: Internet
Author: User

' Anti-quote ' ' single quote ' ' double quotation mark '

1. Three symbols, anti-quote This is very special, I use a lot in the shell script, its function is to directly refer to the result of a command.

Let's take the example, Rpm-qf ' which vim ' you can split this command into two parts, which vim can find the absolute path of the VIM command/usr/bin/vim, and then rpm-qf/usr/bin/vim so that you can find vim this Which package the command is installed from. Because RPM has to be checked by an absolute path.

Single and double quotation marks, often used on special characters, are common in grep sed awk, where single quotes are more powerful than double quotes, which can simply kill the original meaning of some special symbols . Example:

A=1; echo "A is $a"

A=1; Echo ' A is $a '

You can see that the double quotes answer is correct, and the single quotation marks are not correct.


Three the difference and usage of quotation marks

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.