Linux is generally encoded with utf-8, and when we edit a file on Windows it is gb2312 encoding. So the Chinese encoding will be garbled. It's really easy to correct the problem by simply converting the file into UTF-8 encoded format and then importing it OK.
To manually change the configuration file command:
vi/etc/sysconfig/i18n
will lang= "ZH_CN. UTF-8 "modified to: lang=" ZH_CN.GBK "
Save and close, and run the following command to make the configuration effective:
source/etc/sysconfig/i18n
Display the terminal character encoding as Simplified Chinese:
vi/etc/profile.d/chinese.sh
Add the following line: Export LC_ALL=ZH_CN. GBK
source/etc/profile.d/chinese.sh
OK, configuration complete, test it!
[[email protected] bin]#VI one.sh## ====================================================#### auth:wonter # ### date:2014-06-12 # ### to:one.sh # ### ====================================================###!/bin/sh#Get server list letter 1m|/./. List.ll#Execute get File script#nameList1= (' Cat.. /tools/list | Awk'{print $}'| Sed"1,1d"`) for((i=0;i<${#list1[@]};i++));Do sh./${list1[i]}.wydoneecho" "Echo"------------------------------------------------------"Echo" "Echo"The first step is completed, please follow the instructions below to modify the relevant configuration file! "Echo" "Echo"#conf"Echo" "Echo"Once you have modified the configuration, go back to this directory and execute the two.sh script. "Echo" "Echo"------------------------------------------------------"
And look at the previous garbled.
## ====================================================#### auth:wonter # ### date:2014-06-12 # ### to:one.sh # ### ====================================================###!/bin/sh#m~n1m~o~vm~\~mm~j1m~y1m~h~w Table Letter M~a/.list.ll#m~i[1m~lm~n1m~o~vm~v~g pieces M~d~zm~\nameList1= (' Cat.. /tools/list | Awk'{print $}'| Sed"1,1d"`) for((i=0;i<${#list1[@]};i++));Do sh./${list1[i]}.wydoneecho" "Echo"------------------------------------------------------"Echo" "Echo"section [email protected] Step m~i[1m~l1m~l1m~u1m~l please m~i[1m~l1m~km~v1m~o~p m~q1m~l repair m~t1m~[1m~e1m~e~m m~v~g parts 1m~a"Echo" "Echo"#conf"Echo" "Echo"Repair M~t1m~[1m~e1m~e~m m~p~n1m~l please m~f~mm~[~^m~h1m~\1m~[[1m~u1m~k1m~lm~i[1m~l two.sh m~d~zm~\"Echo" "Echo"------------------------------------------------------"
Test success, share to everyone! Please pay attention to share ....