shell script Transplant (windwos ported to linux)

1. The issue of migration shell script:

  From the windows of writing a script to perform the transplant will be garbled on linux, ^ M line breaks and other problems.

  

 

 

  Garbled:

      Coding problem, windows coding for the gb18030

           linux encoded as utf8

       solution:

          txt windows at the time of writing, when you save, you can select utf-8,

                    

 

  Line breaks ^ M:

      ^ Origin and role of M characters: in DOS / Windows, the text file is a newline \ r \ n, while nix system, compared with \ n, so the DOS / Windows in the edited text file to nix, every and his party are more than a ^ M.

  problem solved:

    There are many methods online, but does not apply a large number of servers.

      Here select the encoding solve (use notepad):

          Copy the script to the notepad. Select encoded as UFT-8-BOM., Can be solved, transplant without error.

      

 

 

          

 

 

Guess you like

Origin www.cnblogs.com/pangya/p/11887447.html