1. 程式人生 > >SHELL syntax error unexpected end of file 提示錯誤

SHELL syntax error unexpected end of file 提示錯誤

if    [ -n "$1" ] then   echo "111" else   echo "222" fi exit 0 執行sh my.sh par 提示syntax error:unexpected end of file.錯誤請問為什麼啊 我是在windows下通過記事本編寫的這個檔案,執行 在cygwin模擬LINUX軟體環境下。 我想語法本身應該沒有問題的,是不是字符集編碼影響的呢,如何更改啊。