System character set causes SED execution to complete without exiting

Source: Internet
Author: User
Tags i18n

Because the website needs to replace the code in bulk, it was quite simple one thing but the whole day!

Execute a simple sed batch replacement script sh th.sh, only a directory of 200 megabytes, executed the long time, so feel a problem, CTRL + C stop, plus the- x output details, find a file when stuck, so manual sed this file does not exit after execution, need CTRL + C stop (also tried a simple string substitution)

At first the suspect is a dynamic file, so copy this file to another directory, but the same as the effect, copy this file to another server to perform normal. Also check Bing and Google have the same problem but did not answer, try to vim this file, there are a lot of Chinese garbled, Xshell character set to Utf-8, normal display, but the system Chinese hint is garbled , so the suspicion and the system character set Have a relationship (the system is a former OPS colleague), see /etc/sysconfig/i18n after the discovery lang= "zh_cn.gb18030" , instead Lang= "ZH_CN. UTF-8 " (before backup)

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8A/0F/wKiom1glOjPDLyuVAAGAF6lNmA4923.png-wh_500x0-wm_3 -wmp_4-s_543005309.png "title=" Q@_g1ld7hz}q0g@0%u6qsgm.png "alt=" Wkiom1glojpdlyuvaagaf6lnma4923.png-wh_50 "/>

# source/etc/sysconfig/i18n #使之立即生效

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8A/0B/wKioL1glOkig4BOoAADn86lUkRs624.png-wh_500x0-wm_3 -wmp_4-s_2375169082.png "title=" ~) bi@x$ylo2e3rbsbgpldp.png "alt=" Wkiol1glokig4booaadn86lukrs624.png-wh_50 "/>

The re-test found to be functioning properly. Make a note to the back of the children's shoes


Summary: The system character set and the HTML file character set are not uniform

Note: During the search Bing found some netizens shell scripts also appear non-dead loop does not quit, or there is a relationship!





This article is from the "Linux_wei" blog, make sure to keep this source http://linuxww.blog.51cto.com/11418425/1871733

System character set causes SED execution to complete without exiting

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.