Sometimes writing good one scripts under Windows, copying to Linux does not work properly, the surface can not see the script syntax problems, but it does not work properly, and sometimes a script under Linux can run normally, but from somewhere in Windows (from the file or mailbox) copy a few commands , pasted into this script in Linux, and saved, the script also becomes not functioning properly. In both cases (in fact, the script in Linux contains content from Windows), the basic reason is that the file formats of the two systems are different.
Under Windows, the file line break is \ r \ n, and under Linux, it is \ n. This discrepancy causes a scripting error. When a file under Linux contains content from Windows, or the file is from Windows, use the command
Dos2unix < file name >
The problem of converting its format to file format differences is resolved.
Windows and Linux file formats for mutual transfer