Last active
December 23, 2015 15:29
-
-
Save baijian/6656049 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vim下查看文件编码 | |
| :set fileencoding | |
| 修改文件编码为utf-8 | |
| :set fileencoding=utf-8 | |
| unix2dos 是把linux文件格式转换成windows文件格式 | |
| dos2unix 是把windows格式转换成linux文件格式 | |
| To fix, open your script with vi or vim and enter in vi command mode (key ESC), then type this: | |
| :set fileformat=unix | |
| sed -i 's/\r//' filename | |
| cat file_name.sh | tr -d '\r' > file_name.sh.new | |
| If you're on OS X, you can change line endings in XCode by opening the file and selecting the | |
| View -> Text -> Line Endings -> Unix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment