shell命令在windows下編輯過后出現Syntax error: end of file unexpected (expecting "then") 提示錯誤
這是因為我在windows下些的腳本,windows和linux的回車換行時不一樣的字符,所以腳本在解釋時會出現問題。
在windows里,換行用的兩個符號,回車換\r行符號\n,在linux下只需一個符號\n就可以了.
sed -i 's/\r$//' autoconf.sh
通過命令把換行符轉換一下就可以了.