sh file under window is transcoded in linux

1) Convert under Windows:

Use some editors such as UltraEdit or EditPlus to convert the script code first, and then put it into Linux for execution. The conversion method is as follows (UltraEdit): File-->Conversions-->DOS->UNIX.

2) Method Open the sh file

with vim, enter:
[plain]
:set ff
press Enter, display fileformat=dos, reset the file format (www.111cn.net):
[plain]
:set ff=unix
Save and exit:
[plain]
:wq
and then execute it, it works 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326495844&siteId=291194637