Chinese and English double quotes in the shell

Source: Internet
Author: User

When you replace characters in text with SED, you accidentally add a Chinese double quotation mark when the character is added, and when the result is replaced, you cannot always replace it.

The file name is called A.txt and the text reads as follows:

"" https://www.baidu.com/

To replace the "", use the command sed-i ' s# "" # #g ' a.txt always replace, here you can see the two different double quotes, but it is not easy to notice in the shell, think of the need to escape the character, the use of escape characters do not.

Finally found that the double quotation marks in the command seem to be more straight than the station in the text content, suddenly, it is estimated that the English and Chinese quotation marks caused. Copy and paste the double quotation marks in the text into the command, and you are sure to replace it.

When there is a problem with symbols, pay attention to the differences between Chinese and English

This article is from the "Gan mu" blog, please be sure to keep this source http://ganmu.blog.51cto.com/9305511/1865131

Chinese and English double quotes in the shell

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.